Skip to content

Commit ec19b8e

Browse files
committed
v2.0 c demos
1 parent 10bac86 commit ec19b8e

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

.github/workflows/c-demos.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,28 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
xpu: [ cpu ]
42-
make_file: [ "Unix Makefiles" ]
43-
machine: [ rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-linux, pv-ios ]
41+
device: [ best ]
42+
machine: [ rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-windows-arm64 ]
4443
include:
45-
- xpu: gpu
46-
machine: pv-linux
47-
make_file: "Unix Makefiles"
48-
- xpu: gpu
49-
machine: pv-windows
50-
make_file: "MinGW Makefiles"
51-
- xpu: cpu
52-
machine: pv-windows
53-
make_file: "MinGW Makefiles"
54-
- xpu: gpu
55-
machine: pv-windows-igpu
56-
make_file: "MinGW Makefiles"
57-
- xpu: cpu
58-
machine: pv-windows-arm64
59-
make_file: "MinGW Makefiles"
44+
- machine: rpi4-32
45+
make_file: "Unix Makefiles"
46+
- machine: rpi4-64
47+
make_file: "Unix Makefiles"
48+
- machine: rpi5-32
49+
make_file: "Unix Makefiles"
50+
- machine: rpi5-64
51+
make_file: "Unix Makefiles"
52+
- machine: pv-windows-arm64
53+
make_file: "MinGW Makefiles"
54+
- device: gpu
55+
machine: pv-linux
56+
make_file: "Unix Makefiles"
57+
- device: gpu
58+
machine: pv-windows
59+
make_file: "MinGW Makefiles"
60+
- device: gpu
61+
machine: pv-ios
62+
make_file: "Unix Makefiles"
6063

6164
steps:
6265
- uses: actions/checkout@v3
@@ -88,4 +91,4 @@ jobs:
8891
run: python3 -m pip install -r test/requirements.txt
8992

9093
- name: Test
91-
run: python test/test_picollm_c.py ${{secrets.PV_VALID_ACCESS_KEY}} ./phi2-290.pllm ${{matrix.xpu}}
94+
run: python test/test_picollm_c.py ${{secrets.PV_VALID_ACCESS_KEY}} ./phi2-290.pllm ${{matrix.device}}

demo/c/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Running the demo without arguments prints the usage:
8585

8686
```console
8787
Usage: ./demo/c/build/picollm_demo_completion -a ACCESS_KEY -l LIBRARY_PATH -m MODEL_PATH
88-
[-d DEVICE] [-c COMPLETION_TOKEN_LIMIT] [-s STOP_PHRASES] [-e SEED] [-r PRESENCE_PENALTY]
88+
[-y DEVICE] [-c COMPLETION_TOKEN_LIMIT] [-s STOP_PHRASES] [-e SEED] [-r PRESENCE_PENALTY]
8989
[-f FREQUENCY_PENALTY] [-o TOP_P] [-t TEMPERATURE] [-n MAX_OUTPUT_TOKENS] [-c NUM_TOP_CHOICES]
9090
[-v] [-h] -p PROMPT
9191
-v: enable verbose output

demo/c/picollm_demo_completion.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void usage(const char *program) {
126126
(void) fprintf(
127127
stderr,
128128
"Usage: %s -a ACCESS_KEY -l LIBRARY_PATH -m MODEL_PATH "
129-
"[-d DEVICE] [-s STOP_PHRASES] [-n MAX_OUTPUT_TOKENS] [-c NUM_TOP_CHOICES] "
129+
"[-y DEVICE] [-s STOP_PHRASES] [-n MAX_OUTPUT_TOKENS] [-c NUM_TOP_CHOICES] "
130130
"[-r PRESENCE_PENALTY] [-f FREQUENCY_PENALTY] "
131131
"[-o TOP_P] [-t TEMPERATURE] [-e SEED] [-v] [-h] -p PROMPT\n"
132132
"-v: enable verbose output\n"
@@ -161,7 +161,7 @@ static void progress_callback(const char *token, void *context) {
161161
}
162162

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

166166
const char *access_key = NULL;
167167
const char *model_path = NULL;
@@ -258,7 +258,7 @@ int picovoice_main(int argc, char **argv) {
258258
optind = i;
259259
}
260260
break;
261-
case 'd':
261+
case 'y':
262262
device_string = optarg;
263263
break;
264264
case 'v':

demo/c/test/test_picollm_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_picollm(self):
3131
"-a", self._access_key,
3232
"-l", pv_library_path("../../.."),
3333
"-m", self._model_path,
34-
"-d", self._device,
34+
"-y", self._device,
3535
"-p", "Instruct: Where is the capital city of British Columbia?\nOutput:",
3636
]
3737
process = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE)

0 commit comments

Comments
 (0)