Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,21 +88,22 @@ with youtube_url_tab:
|
|
| 88 |
|
| 89 |
with file_select_tab:
|
| 90 |
video_file = st.file_uploader("Upload video file", type="mp4")
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
if video_file:
|
| 95 |
-
if st.button("Transcribe", key="vidfile"):
|
| 96 |
-
with st.spinner("Transcribing..."):
|
| 97 |
-
audio = audio_extraction(os.fspath(video_file), "mp3")
|
| 98 |
-
video_transcript = transcribe_video(audio)
|
| 99 |
-
st.success(f"Transcription successful")
|
| 100 |
-
st.write(video_transcript)
|
| 101 |
-
if st.button("Generate Summary", key="ti2"):
|
| 102 |
-
summary = generate_ai_summary(video_transcript)
|
| 103 |
-
st.write(summary)
|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
# Audio transcription
|
| 107 |
with audio_file_tab:
|
| 108 |
audio_file = st.file_uploader("Upload audio file", type="mp3")
|
|
|
|
| 88 |
|
| 89 |
with file_select_tab:
|
| 90 |
video_file = st.file_uploader("Upload video file", type="mp4")
|
| 91 |
+
try:
|
| 92 |
+
video_file = video_file.getvalue()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
if video_file:
|
| 95 |
+
if st.button("Transcribe", key="vidfile"):
|
| 96 |
+
with st.spinner("Transcribing..."):
|
| 97 |
+
audio = audio_extraction(os.fspath(video_file), "mp3")
|
| 98 |
+
video_transcript = transcribe_video(audio)
|
| 99 |
+
st.success(f"Transcription successful")
|
| 100 |
+
st.write(video_transcript)
|
| 101 |
+
if st.button("Generate Summary", key="ti2"):
|
| 102 |
+
summary = generate_ai_summary(video_transcript)
|
| 103 |
+
st.write(summary)
|
| 104 |
+
|
| 105 |
+
except:
|
| 106 |
+
st.error("Upload a valid mp4 file")
|
| 107 |
# Audio transcription
|
| 108 |
with audio_file_tab:
|
| 109 |
audio_file = st.file_uploader("Upload audio file", type="mp3")
|