Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def content_input_update(content_type):
|
|
57 |
gr.update(visible=visible_video)
|
58 |
)
|
59 |
|
60 |
-
def transcribe_content(content_type, audio_path,
|
61 |
if content_type == "Audio Upload" and audio_path:
|
62 |
return whispermodel.transcribe(audio_path)["text"]
|
63 |
elif content_type == "Video Upload" and video:
|
@@ -100,7 +100,7 @@ def main(content_type, audio_path, video, language, summarize):
|
|
100 |
global transcription, languageG
|
101 |
languageG = language
|
102 |
|
103 |
-
transcription = transcribe_content(content_type, audio_path,
|
104 |
if not transcription:
|
105 |
return "No transcription available.", "No Q&A requested.", None
|
106 |
|
@@ -159,9 +159,9 @@ with gr.Blocks() as demo:
|
|
159 |
|
160 |
qa_button.click(lambda question: interactive_qa(question), inputs=[user_question], outputs=qa_response)
|
161 |
|
162 |
-
content_type.change(content_input_update, inputs=[content_type], outputs=[file_input,
|
163 |
submit_btn = gr.Button("Submit")
|
164 |
-
submit_btn.click(main, inputs=[content_type, file_input,
|
165 |
outputs=[summary_output, audio_output])
|
166 |
|
167 |
demo.launch(share=True)
|
|
|
57 |
gr.update(visible=visible_video)
|
58 |
)
|
59 |
|
60 |
+
def transcribe_content(content_type, audio_path, video):
|
61 |
if content_type == "Audio Upload" and audio_path:
|
62 |
return whispermodel.transcribe(audio_path)["text"]
|
63 |
elif content_type == "Video Upload" and video:
|
|
|
100 |
global transcription, languageG
|
101 |
languageG = language
|
102 |
|
103 |
+
transcription = transcribe_content(content_type, audio_path, video)
|
104 |
if not transcription:
|
105 |
return "No transcription available.", "No Q&A requested.", None
|
106 |
|
|
|
159 |
|
160 |
qa_button.click(lambda question: interactive_qa(question), inputs=[user_question], outputs=qa_response)
|
161 |
|
162 |
+
content_type.change(content_input_update, inputs=[content_type], outputs=[file_input, video_input])
|
163 |
submit_btn = gr.Button("Submit")
|
164 |
+
submit_btn.click(main, inputs=[content_type, file_input, video_input, language, summarize],
|
165 |
outputs=[summary_output, audio_output])
|
166 |
|
167 |
demo.launch(share=True)
|