Skip to content

Commit bfd19ad

Browse files
committed
Use shorter syntax for --build-reascripts parameter to run.py
1 parent be4926a commit bfd19ad

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

app/run.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@
3030
'default': os.getenv('ASR_MODEL', 'small'),
3131
'help': 'ASR model to use (default: %(default)s)' },
3232
'--build-reascripts': {
33-
'action': 'store_true',
34-
'help': 'Build ReaScripts before starting' },
35-
'--build-reascripts-target': {
36-
'default': 'publish5.4',
37-
'help': 'ReaScripts build target (default: %(default)s)' },
33+
'const': 'publish5.4',
34+
'nargs': '?',
35+
'help': 'Build ReaScripts before starting. Optional value specifies target (default: %(const)s)' },
3836
'--enable-swagger-ui': {
3937
'action': 'store_true',
4038
'help': 'Enable automatic Swagger UI for API' },
@@ -56,7 +54,7 @@
5654

5755
if args.build_reascripts:
5856
print('Building ReaScripts...', file=sys.stderr)
59-
if os.system(f'cd reascripts/ReaSpeech && make {args.build_reascripts_target}') != 0:
57+
if os.system(f'cd reascripts/ReaSpeech && make {args.build_reascripts}') != 0:
6058
print('ReaScript build failed', file=sys.stderr)
6159
sys.exit(1)
6260

docker-compose.gpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
args:
77
- SERVICE_UID
88
- SERVICE_GID
9-
entrypoint: ["python3", "app/run.py", "--build-reascripts", "--build-reascripts-target=all"]
9+
entrypoint: ["python3", "app/run.py", "--build-reascripts=all"]
1010
deploy:
1111
resources:
1212
reservations:

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
args:
77
- SERVICE_UID
88
- SERVICE_GID
9-
entrypoint: ["python3", "app/run.py", "--build-reascripts", "--build-reascripts-target=all"]
9+
entrypoint: ["python3", "app/run.py", "--build-reascripts=all"]
1010
environment:
1111
- ASR_ENGINE=faster_whisper
1212
ports:

0 commit comments

Comments
 (0)