Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,15 +14,14 @@ from dotenv import load_dotenv
|
|
14 |
load_dotenv()
|
15 |
|
16 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
17 |
-
google_genai.configure(api_key=
|
18 |
-
GOOGLE_API_KEY)
|
19 |
|
20 |
st.set_page_config(
|
21 |
page_title="VidText"
|
22 |
)
|
23 |
|
24 |
st.title("VidText-whisper")
|
25 |
-
st.
|
26 |
|
27 |
def youtube_video_downloader(url):
|
28 |
yt_vid = YouTube(url)
|
@@ -56,7 +55,7 @@ def audio_processing(mp3_audio):
|
|
56 |
|
57 |
@st.cache_resource
|
58 |
def load_asr_model():
|
59 |
-
asr_model = pipeline(task="automatic-speech-recognition", model="
|
60 |
return asr_model
|
61 |
|
62 |
transcriber_model = load_asr_model()
|
@@ -83,8 +82,7 @@ with youtube_url_tab:
|
|
83 |
|
84 |
yt_video, title = youtube_video_downloader(url)
|
85 |
if url:
|
86 |
-
if st.button("Transcribe", key
|
87 |
-
="yturl"):
|
88 |
with st.spinner("Transcribing..."):
|
89 |
with st.spinner('Extracting audio...'):
|
90 |
audio = audio_extraction(yt_video)
|
|
|
14 |
load_dotenv()
|
15 |
|
16 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
17 |
+
google_genai.configure(api_key=GOOGLE_API_KEY)
|
|
|
18 |
|
19 |
st.set_page_config(
|
20 |
page_title="VidText"
|
21 |
)
|
22 |
|
23 |
st.title("VidText-whisper")
|
24 |
+
st.subheader("A video/audio transcription app")
|
25 |
|
26 |
def youtube_video_downloader(url):
|
27 |
yt_vid = YouTube(url)
|
|
|
55 |
|
56 |
@st.cache_resource
|
57 |
def load_asr_model():
|
58 |
+
asr_model = pipeline(task="automatic-speech-recognition", model="openai/whisper-small")
|
59 |
return asr_model
|
60 |
|
61 |
transcriber_model = load_asr_model()
|
|
|
82 |
|
83 |
yt_video, title = youtube_video_downloader(url)
|
84 |
if url:
|
85 |
+
if st.button("Transcribe", key="yturl"):
|
|
|
86 |
with st.spinner("Transcribing..."):
|
87 |
with st.spinner('Extracting audio...'):
|
88 |
audio = audio_extraction(yt_video)
|