Support specifying provider for python examples (#244)

This commit is contained in:
Fangjun Kuang
2023-08-09 10:00:34 +08:00
committed by GitHub
parent 6235cb9f1b
commit aeb112dd06
4 changed files with 35 additions and 1 deletions

View File

@@ -79,6 +79,13 @@ def get_args():
""",
)
parser.add_argument(
"--provider",
type=str,
default="cpu",
help="Valid values: cpu, cuda, coreml",
)
parser.add_argument(
"--bpe-model",
type=str,
@@ -204,6 +211,7 @@ def main():
decoder=args.decoder,
joiner=args.joiner,
num_threads=args.num_threads,
provider=args.provider,
sample_rate=16000,
feature_dim=80,
decoding_method=args.decoding_method,
@@ -220,7 +228,6 @@ def main():
print(f"Contexts list: {contexts}")
contexts_list = encode_contexts(args, contexts)
streams = []
total_duration = 0
for wave_filename in args.sound_files: