Spaces:
Sleeping
Sleeping
Added exception handling
Browse files
app.py
CHANGED
@@ -64,17 +64,19 @@ youtube_url_tab, file_select_tab, audio_file_tab = st.tabs(
|
|
64 |
|
65 |
with youtube_url_tab:
|
66 |
url = st.text_input("Enter the Youtube url")
|
67 |
-
|
68 |
-
|
69 |
-
if
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
78 |
|
79 |
# Video file transcription
|
80 |
|
@@ -83,7 +85,7 @@ with file_select_tab:
|
|
83 |
|
84 |
|
85 |
if video_file:
|
86 |
-
if st.button("Transcribe"):
|
87 |
with st.spinner("Transcribing..."):
|
88 |
audio = audio_extraction(video_file, "mp3")
|
89 |
video_transcript = transcribe_video(audio)
|
@@ -99,7 +101,7 @@ with audio_file_tab:
|
|
99 |
audio_file = st.file_uploader("Upload audio file", type="mp3")
|
100 |
|
101 |
if audio_file:
|
102 |
-
if st.button("Transcribe"):
|
103 |
with st.spinner("Transcribing..."):
|
104 |
processed_audio = audio_processing(audio_file)
|
105 |
audio_transcript = transcribe_video(processed_audio)
|
|
|
64 |
|
65 |
with youtube_url_tab:
|
66 |
url = st.text_input("Enter the Youtube url")
|
67 |
+
try:
|
68 |
+
yt_video, title = youtube_video_downloader(url)
|
69 |
+
if url:
|
70 |
+
if st.button("Transcribe", key="yturl"):
|
71 |
+
with st.spinner("Transcribing..."):
|
72 |
+
ytvideo_transcript = transcribe_video(yt_video)
|
73 |
+
st.success(f"Transcription successful")
|
74 |
+
st.write(ytvideo_transcript)
|
75 |
+
if st.button("Generate Summary"):
|
76 |
+
summary = generate_ai_summary(ytvideo_transcript)
|
77 |
+
st.write(summary)
|
78 |
+
except Exception as e:
|
79 |
+
st.error(e)
|
80 |
|
81 |
# Video file transcription
|
82 |
|
|
|
85 |
|
86 |
|
87 |
if video_file:
|
88 |
+
if st.button("Transcribe", key="vidfile"):
|
89 |
with st.spinner("Transcribing..."):
|
90 |
audio = audio_extraction(video_file, "mp3")
|
91 |
video_transcript = transcribe_video(audio)
|
|
|
101 |
audio_file = st.file_uploader("Upload audio file", type="mp3")
|
102 |
|
103 |
if audio_file:
|
104 |
+
if st.button("Transcribe", key="audiofile"):
|
105 |
with st.spinner("Transcribing..."):
|
106 |
processed_audio = audio_processing(audio_file)
|
107 |
audio_transcript = transcribe_video(processed_audio)
|