Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def whisper_demo(input_audio, model_id):
|
|
27 |
pipe = pipeline(task="automatic-speech-recognition",model=model_id, device='cuda:0')
|
28 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language='en', task="transcribe")
|
29 |
output_text = pipe(input_audio)['text']
|
30 |
-
return output_text
|
31 |
|
32 |
|
33 |
def translate_to_english(prompt, lang_model_id, base_lang):
|
@@ -79,6 +79,7 @@ def biogpt_audio(
|
|
79 |
en_prompt = whisper_demo(input_audio=input_audio, model_id=whisper_model_id)
|
80 |
generator = pipeline("text-generation", model=biogpt_model_id, device="cuda:0")
|
81 |
output = generator(en_prompt, max_length=250, num_return_sequences=1, do_sample=True)
|
|
|
82 |
if base_lang == "English":
|
83 |
output_text = output
|
84 |
|
|
|
27 |
pipe = pipeline(task="automatic-speech-recognition",model=model_id, device='cuda:0')
|
28 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language='en', task="transcribe")
|
29 |
output_text = pipe(input_audio)['text']
|
30 |
+
return output_text
|
31 |
|
32 |
|
33 |
def translate_to_english(prompt, lang_model_id, base_lang):
|
|
|
79 |
en_prompt = whisper_demo(input_audio=input_audio, model_id=whisper_model_id)
|
80 |
generator = pipeline("text-generation", model=biogpt_model_id, device="cuda:0")
|
81 |
output = generator(en_prompt, max_length=250, num_return_sequences=1, do_sample=True)
|
82 |
+
output = output[0]['generated_text']
|
83 |
if base_lang == "English":
|
84 |
output_text = output
|
85 |
|