Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,13 +45,11 @@ def translate_text(text, destination_language):
|
|
45 |
|
46 |
# Initialize the speech-to-text pipeline (Whisper model)
|
47 |
# Use a pipeline as a high-level helper
|
48 |
-
|
49 |
-
|
50 |
-
pipe = pipeline("text-to-audio", model="facebook/musicgen-small")
|
51 |
|
52 |
# Function to transcribe audio to text
|
53 |
def transcribe_audio(audio_file, destination_language):
|
54 |
-
transcription =
|
55 |
return translate_text(transcription, destination_language)
|
56 |
|
57 |
# Gradio interface
|
@@ -89,4 +87,4 @@ with gr.Blocks() as demo:
|
|
89 |
)
|
90 |
|
91 |
if __name__ == "__main__":
|
92 |
-
demo.launch()
|
|
|
45 |
|
46 |
# Initialize the speech-to-text pipeline (Whisper model)
|
47 |
# Use a pipeline as a high-level helper
|
48 |
+
pipe = pipeline("text-to-audio", model="facebook/musicgen-small", attn_implementation="eager")
|
|
|
|
|
49 |
|
50 |
# Function to transcribe audio to text
|
51 |
def transcribe_audio(audio_file, destination_language):
|
52 |
+
transcription = speech_to_text(audio_file)["text"]
|
53 |
return translate_text(transcription, destination_language)
|
54 |
|
55 |
# Gradio interface
|
|
|
87 |
)
|
88 |
|
89 |
if __name__ == "__main__":
|
90 |
+
demo.launch(share=True)
|