Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .github/workflows/c-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,28 @@ jobs:
strategy:
fail-fast: false
matrix:
xpu: [ cpu ]
make_file: [ "Unix Makefiles" ]
machine: [ rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-linux, pv-ios ]
device: [ best ]
machine: [ rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-windows-arm64 ]
include:
- xpu: gpu
machine: pv-linux
make_file: "Unix Makefiles"
- xpu: gpu
machine: pv-windows
make_file: "MinGW Makefiles"
- xpu: cpu
machine: pv-windows
make_file: "MinGW Makefiles"
- xpu: gpu
machine: pv-windows-igpu
make_file: "MinGW Makefiles"
- xpu: cpu
machine: pv-windows-arm64
make_file: "MinGW Makefiles"
- machine: rpi4-32
make_file: "Unix Makefiles"
- machine: rpi4-64
make_file: "Unix Makefiles"
- machine: rpi5-32
make_file: "Unix Makefiles"
- machine: rpi5-64
make_file: "Unix Makefiles"
- machine: pv-windows-arm64
make_file: "MinGW Makefiles"
- device: gpu
machine: pv-linux
make_file: "Unix Makefiles"
- device: gpu
machine: pv-windows
make_file: "MinGW Makefiles"
- device: gpu
machine: pv-ios
make_file: "Unix Makefiles"

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -88,4 +91,4 @@ jobs:
run: python3 -m pip install -r test/requirements.txt

- name: Test
run: python test/test_picollm_c.py ${{secrets.PV_VALID_ACCESS_KEY}} ./phi2-290.pllm ${{matrix.xpu}}
run: python test/test_picollm_c.py ${{secrets.PV_VALID_ACCESS_KEY}} ./phi2-290.pllm ${{matrix.device}}
2 changes: 1 addition & 1 deletion demo/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Running the demo without arguments prints the usage:

```console
Usage: ./demo/c/build/picollm_demo_completion -a ACCESS_KEY -l LIBRARY_PATH -m MODEL_PATH
[-d DEVICE] [-c COMPLETION_TOKEN_LIMIT] [-s STOP_PHRASES] [-e SEED] [-r PRESENCE_PENALTY]
[-y DEVICE] [-c COMPLETION_TOKEN_LIMIT] [-s STOP_PHRASES] [-e SEED] [-r PRESENCE_PENALTY]
[-f FREQUENCY_PENALTY] [-o TOP_P] [-t TEMPERATURE] [-n MAX_OUTPUT_TOKENS] [-c NUM_TOP_CHOICES]
[-v] [-h] -p PROMPT
-v: enable verbose output
Expand Down
6 changes: 3 additions & 3 deletions demo/c/picollm_demo_completion.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void usage(const char *program) {
(void) fprintf(
stderr,
"Usage: %s -a ACCESS_KEY -l LIBRARY_PATH -m MODEL_PATH "
"[-d DEVICE] [-s STOP_PHRASES] [-n MAX_OUTPUT_TOKENS] [-c NUM_TOP_CHOICES] "
"[-y DEVICE] [-s STOP_PHRASES] [-n MAX_OUTPUT_TOKENS] [-c NUM_TOP_CHOICES] "
"[-r PRESENCE_PENALTY] [-f FREQUENCY_PENALTY] "
"[-o TOP_P] [-t TEMPERATURE] [-e SEED] [-v] [-h] -p PROMPT\n"
"-v: enable verbose output\n"
Expand Down Expand Up @@ -161,7 +161,7 @@ static void progress_callback(const char *token, void *context) {
}

int picovoice_main(int argc, char **argv) {
const char *SHORT_OPTIONS = "a:l:m:d:c:s:e:r:f:o:t:n:c:p:vh";
const char *SHORT_OPTIONS = "a:l:m:y:c:s:e:r:f:o:t:n:c:p:vh";

const char *access_key = NULL;
const char *model_path = NULL;
Expand Down Expand Up @@ -258,7 +258,7 @@ int picovoice_main(int argc, char **argv) {
optind = i;
}
break;
case 'd':
case 'y':
device_string = optarg;
break;
case 'v':
Expand Down
2 changes: 1 addition & 1 deletion demo/c/test/test_picollm_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_picollm(self):
"-a", self._access_key,
"-l", pv_library_path("../../.."),
"-m", self._model_path,
"-d", self._device,
"-y", self._device,
"-p", "Instruct: Where is the capital city of British Columbia?\nOutput:",
]
process = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
Expand Down