Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -175,7 +175,7 @@ def download_yt_audio(yt_url, filename):
|
|
175 |
raise gr.Error(str(err))
|
176 |
|
177 |
|
178 |
-
def yt_transcribe(yt_url,source_lang, target_lang, task, max_filesize=75.0):
|
179 |
html_embed_str = _return_yt_html_embed(yt_url)
|
180 |
global model # S'assurer que le modèle est accessible
|
181 |
|
@@ -191,7 +191,7 @@ def yt_transcribe(yt_url,source_lang, target_lang, task, max_filesize=75.0):
|
|
191 |
transcriptions, translations = full_transcription_and_translation(inputs, source_lang, target_lang)
|
192 |
transcribed_text = '\n'.join([f"{timestamp}: {text}" for timestamp, text in transcriptions])
|
193 |
translated_text = '\n'.join([f"{timestamp}: {text}" for timestamp, text in translations])
|
194 |
-
return html_embed_str, transcribed_text, translated_text
|
195 |
|
196 |
|
197 |
# Interfaces
|
@@ -218,7 +218,7 @@ with demo:
|
|
218 |
outputs=[gr.Textbox(label="Transcribed Text"), gr.Textbox(label="Translated Text")]
|
219 |
)
|
220 |
|
221 |
-
with gr.Tab("YouTube"):
|
222 |
gr.Interface(
|
223 |
fn=yt_transcribe,
|
224 |
inputs=[
|
@@ -227,7 +227,7 @@ with demo:
|
|
227 |
gr.Dropdown(lang_codes, value='English', label='Target Language')
|
228 |
],
|
229 |
outputs=["html", gr.Textbox(label="Transcribed Text"), gr.Textbox(label="Translated Text")]
|
230 |
-
)
|
231 |
|
232 |
#with demo:
|
233 |
#gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
|
|
|
175 |
raise gr.Error(str(err))
|
176 |
|
177 |
|
178 |
+
"""def yt_transcribe(yt_url,source_lang, target_lang, task, max_filesize=75.0):
|
179 |
html_embed_str = _return_yt_html_embed(yt_url)
|
180 |
global model # S'assurer que le modèle est accessible
|
181 |
|
|
|
191 |
transcriptions, translations = full_transcription_and_translation(inputs, source_lang, target_lang)
|
192 |
transcribed_text = '\n'.join([f"{timestamp}: {text}" for timestamp, text in transcriptions])
|
193 |
translated_text = '\n'.join([f"{timestamp}: {text}" for timestamp, text in translations])
|
194 |
+
return html_embed_str, transcribed_text, translated_text"""
|
195 |
|
196 |
|
197 |
# Interfaces
|
|
|
218 |
outputs=[gr.Textbox(label="Transcribed Text"), gr.Textbox(label="Translated Text")]
|
219 |
)
|
220 |
|
221 |
+
"""with gr.Tab("YouTube"):
|
222 |
gr.Interface(
|
223 |
fn=yt_transcribe,
|
224 |
inputs=[
|
|
|
227 |
gr.Dropdown(lang_codes, value='English', label='Target Language')
|
228 |
],
|
229 |
outputs=["html", gr.Textbox(label="Transcribed Text"), gr.Textbox(label="Translated Text")]
|
230 |
+
)"""
|
231 |
|
232 |
#with demo:
|
233 |
#gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
|