Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
9e835c6
1
Parent(s):
58fc552
add gpu
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def init_model(model_dir_aed):
|
|
| 15 |
if asr_model_aed is None:
|
| 16 |
asr_model_aed = FireRedAsr.from_pretrained("aed", model_dir_aed)
|
| 17 |
|
| 18 |
-
|
| 19 |
def asr_inference(audio_file):
|
| 20 |
if not audio_file:
|
| 21 |
return "Please upload a wav file"
|
|
@@ -25,7 +25,7 @@ def asr_inference(audio_file):
|
|
| 25 |
batch_uttid,
|
| 26 |
batch_wav_path,
|
| 27 |
{
|
| 28 |
-
"use_gpu":
|
| 29 |
"beam_size": 3,
|
| 30 |
"nbest": 1,
|
| 31 |
"decode_max_len": 0,
|
|
|
|
| 15 |
if asr_model_aed is None:
|
| 16 |
asr_model_aed = FireRedAsr.from_pretrained("aed", model_dir_aed)
|
| 17 |
|
| 18 |
+
@spaces.GPU(duration=20)
|
| 19 |
def asr_inference(audio_file):
|
| 20 |
if not audio_file:
|
| 21 |
return "Please upload a wav file"
|
|
|
|
| 25 |
batch_uttid,
|
| 26 |
batch_wav_path,
|
| 27 |
{
|
| 28 |
+
"use_gpu": True,
|
| 29 |
"beam_size": 3,
|
| 30 |
"nbest": 1,
|
| 31 |
"decode_max_len": 0,
|