Spaces:
Sleeping
Sleeping
Switched models
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def audio_processing(mp3_audio):
|
|
54 |
|
55 |
@st.cache_resource
|
56 |
def load_asr_model():
|
57 |
-
asr_model = pipeline(task="automatic-speech-recognition", model="
|
58 |
return asr_model
|
59 |
|
60 |
transcriber_model = load_asr_model()
|
@@ -72,26 +72,25 @@ def generate_ai_summary(transcript):
|
|
72 |
|
73 |
# Streamlit UI
|
74 |
|
75 |
-
file_select_tab, audio_file_tab = st.tabs([ "Video file", "Audio file"])
|
76 |
|
77 |
-
|
78 |
-
|
79 |
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
#
|
90 |
-
# # st.write(f'Completed in {run_time}')
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
|
96 |
|
97 |
# Video file transcription
|
|
|
54 |
|
55 |
@st.cache_resource
|
56 |
def load_asr_model():
|
57 |
+
asr_model = pipeline(task="automatic-speech-recognition", model="distil-whisper/distil-large-v3")
|
58 |
return asr_model
|
59 |
|
60 |
transcriber_model = load_asr_model()
|
|
|
72 |
|
73 |
# Streamlit UI
|
74 |
|
75 |
+
youtube_url_tab, file_select_tab, audio_file_tab = st.tabs(["Youtube URL","Video file", "Audio file"])
|
76 |
|
77 |
+
with youtube_url_tab:
|
78 |
+
url = st.text_input("Enter the Youtube url")
|
79 |
|
80 |
|
81 |
+
yt_video, title = youtube_video_downloader(url)
|
82 |
+
if url:
|
83 |
+
if st.button("Transcribe", key="yturl"):
|
84 |
+
with st.spinner("Transcribing..."):
|
85 |
+
audio = audio_extraction(yt_video)
|
86 |
+
ytvideo_transcript = transcriber_pass(audio)
|
87 |
+
st.success(f"Transcription successful")
|
88 |
+
st.write(ytvideo_transcript)
|
89 |
+
# st.write(f'Completed in {run_time}')
|
|
|
90 |
|
91 |
+
if st.button("Generate Summary"):
|
92 |
+
summary = generate_ai_summary(ytvideo_transcript)
|
93 |
+
st.write(summary)
|
94 |
|
95 |
|
96 |
# Video file transcription
|