Update app.py
Browse files
app.py
CHANGED
@@ -24,8 +24,9 @@ def transcribe_and_summarize(file_path):
|
|
24 |
transcript = " ".join([segment.text for segment in segments])
|
25 |
|
26 |
# ืกืืืื ืืชืืืื
|
27 |
-
summary = summarizer(transcript, max_length=50, min_length=25, do_sample=False)[0]["summary_text"]
|
28 |
|
|
|
|
|
29 |
# ืืืืงืช ืงืืืฅ ืืืืืื ืืืืืช ืืฆืืจื (ืื ืืื ืืืืื)
|
30 |
if audio_file != file_path:
|
31 |
os.remove(audio_file)
|
@@ -46,7 +47,10 @@ def convert_video_to_audio(video_file):
|
|
46 |
interface = gr.Interface(
|
47 |
fn=transcribe_and_summarize,
|
48 |
inputs=gr.Audio(type="filepath"),
|
49 |
-
outputs=[
|
|
|
|
|
|
|
50 |
title="ืืืืจ ืืืืื/ืืืืื ืืชืืืื ืืกืืืื",
|
51 |
description="ืืขืื ืงืืืฅ ืืืืื ืื ืืืืื ืฉื ืืจืฆื ืืงืื ืชืืืื ืืื ืืกืืืื ืงืฆืจ ืฉื ืืชืืื."
|
52 |
)
|
|
|
24 |
transcript = " ".join([segment.text for segment in segments])
|
25 |
|
26 |
# ืกืืืื ืืชืืืื
|
|
|
27 |
|
28 |
+
summary = summarizer(transcript, max_length=50, min_length=25, do_sample=False)[0]["summary_text"]
|
29 |
+
prompt_text = f"ืกืื ืืช ืืชืืืื ืืื ืืฉืืขืืจ ืืงืืื ืืขืืจืืช:\n{transcript}"
|
30 |
# ืืืืงืช ืงืืืฅ ืืืืืื ืืืืืช ืืฆืืจื (ืื ืืื ืืืืื)
|
31 |
if audio_file != file_path:
|
32 |
os.remove(audio_file)
|
|
|
47 |
interface = gr.Interface(
|
48 |
fn=transcribe_and_summarize,
|
49 |
inputs=gr.Audio(type="filepath"),
|
50 |
+
outputs=[
|
51 |
+
gr.outputs.Textbox(label="ืชืืืื"),
|
52 |
+
gr.outputs.Textbox(label="ืกืืืื")
|
53 |
+
],
|
54 |
title="ืืืืจ ืืืืื/ืืืืื ืืชืืืื ืืกืืืื",
|
55 |
description="ืืขืื ืงืืืฅ ืืืืื ืื ืืืืื ืฉื ืืจืฆื ืืงืื ืชืืืื ืืื ืืกืืืื ืงืฆืจ ืฉื ืืชืืื."
|
56 |
)
|