Spaces:
Runtime error
Runtime error
torileatherman
commited on
Commit
•
e222aea
1
Parent(s):
ab68c73
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
|
|
3 |
import os
|
4 |
import deepl
|
5 |
import openai
|
|
|
6 |
|
7 |
TARGET_LANG = "EN-GB"
|
8 |
deepl_key = os.environ.get('DEEPL_KEY')
|
@@ -21,9 +22,7 @@ def transcribe_url(url):
|
|
21 |
youtube = YouTube(str(url))
|
22 |
audio = youtube.streams.filter(only_audio=True).first().download('yt_video')
|
23 |
text_sv = pipe(audio)["text"]
|
24 |
-
print(f"Audio transcribed: {text_sv}")
|
25 |
text_en = translator.translate_text(text_sv, target_lang=TARGET_LANG).text
|
26 |
-
print(f"Text translated: {text_en}")
|
27 |
return text_sv, text_en
|
28 |
|
29 |
url_demo = gr.Interface(
|
|
|
3 |
import os
|
4 |
import deepl
|
5 |
import openai
|
6 |
+
from pytube import YouTube
|
7 |
|
8 |
TARGET_LANG = "EN-GB"
|
9 |
deepl_key = os.environ.get('DEEPL_KEY')
|
|
|
22 |
youtube = YouTube(str(url))
|
23 |
audio = youtube.streams.filter(only_audio=True).first().download('yt_video')
|
24 |
text_sv = pipe(audio)["text"]
|
|
|
25 |
text_en = translator.translate_text(text_sv, target_lang=TARGET_LANG).text
|
|
|
26 |
return text_sv, text_en
|
27 |
|
28 |
url_demo = gr.Interface(
|