Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def preprocess_audio(input_audio: str) -> None:
|
|
61 |
gr.Warning(f"Input audio is too long. Only the first {MAX_INPUT_AUDIO_LENGTH} seconds is used.")
|
62 |
torchaudio.save(input_audio, new_arr, sample_rate=int(AUDIO_SAMPLE_RATE))
|
63 |
|
64 |
-
|
65 |
def run_s2tt(input_audio: str, source_language: str, target_language: str) -> str:
|
66 |
# preprocess_audio(input_audio)
|
67 |
# source_language_code = LANGUAGE_NAME_TO_CODE[source_language]
|
@@ -75,7 +75,7 @@ def run_s2tt(input_audio: str, source_language: str, target_language: str) -> st
|
|
75 |
|
76 |
return tokenizer.decode(text_out, clean_up_tokenization_spaces=True, skip_special_tokens=True)
|
77 |
|
78 |
-
|
79 |
def run_asr(input_audio: str, target_language: str) -> str:
|
80 |
# preprocess_audio(input_audio)
|
81 |
target_language_code = LANGUAGE_NAME_TO_CODE[target_language]
|
|
|
61 |
gr.Warning(f"Input audio is too long. Only the first {MAX_INPUT_AUDIO_LENGTH} seconds is used.")
|
62 |
torchaudio.save(input_audio, new_arr, sample_rate=int(AUDIO_SAMPLE_RATE))
|
63 |
|
64 |
+
@spaces.GPU
|
65 |
def run_s2tt(input_audio: str, source_language: str, target_language: str) -> str:
|
66 |
# preprocess_audio(input_audio)
|
67 |
# source_language_code = LANGUAGE_NAME_TO_CODE[source_language]
|
|
|
75 |
|
76 |
return tokenizer.decode(text_out, clean_up_tokenization_spaces=True, skip_special_tokens=True)
|
77 |
|
78 |
+
@spaces.GPU
|
79 |
def run_asr(input_audio: str, target_language: str) -> str:
|
80 |
# preprocess_audio(input_audio)
|
81 |
target_language_code = LANGUAGE_NAME_TO_CODE[target_language]
|