tensorkelechi commited on
Commit
d4a3868
·
verified ·
1 Parent(s): 86ce790

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -47,8 +47,12 @@ def audio_processing(mp3_audio):
47
 
48
 
49
  @st.cache_resource
 
 
 
 
50
  def transcribe_video(_processed_audio):
51
- transcriber_model = pipeline(task="automatic-speech-recognition", model="openai/whisper-large-v3")
52
  text_extract = transcriber_model(_processed_audio)
53
  return text_extract['text']
54
 
@@ -61,7 +65,7 @@ def generate_ai_summary(transcript):
61
  youtube_url_tab, file_select_tab, audio_file_tab = st.tabs(
62
  ["Youtube url", "Video file", "Audio file"]
63
  )
64
-
65
  with youtube_url_tab:
66
  url = st.text_input("Enter the Youtube url")
67
  try:
@@ -95,7 +99,7 @@ with file_select_tab:
95
  summary = generate_ai_summary(video_transcript)
96
  st.write(summary)
97
 
98
-
99
  # Audio transcription
100
  with audio_file_tab:
101
  audio_file = st.file_uploader("Upload audio file", type="mp3")
 
47
 
48
 
49
  @st.cache_resource
50
+ def load_model():
51
+ asr_model = pipeline(task="automatic-speech-recognition", model="openai/whisper-large-v3")
52
+ return asr_model
53
+
54
  def transcribe_video(_processed_audio):
55
+ transcriber_model = load_model()
56
  text_extract = transcriber_model(_processed_audio)
57
  return text_extract['text']
58
 
 
65
  youtube_url_tab, file_select_tab, audio_file_tab = st.tabs(
66
  ["Youtube url", "Video file", "Audio file"]
67
  )
68
+ """
69
  with youtube_url_tab:
70
  url = st.text_input("Enter the Youtube url")
71
  try:
 
99
  summary = generate_ai_summary(video_transcript)
100
  st.write(summary)
101
 
102
+ """
103
  # Audio transcription
104
  with audio_file_tab:
105
  audio_file = st.file_uploader("Upload audio file", type="mp3")