Ofiroz91 commited on
Commit
92c34bf
ยท
verified ยท
1 Parent(s): ca1aa20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -23,9 +23,8 @@ def transcribe_and_summarize(file_path):
23
  segments, _ = model.transcribe(audio_file, language="he")
24
  transcript = " ".join([segment.text for segment in segments])
25
 
26
- # ืกื™ื›ื•ื ื”ืชืžืœื•ืœ ืขื ืžื•ื“ืœ ื‘ืขื‘ืจื™ืช
27
- prompt_text = f"ืกื›ื ืืช ื”ืชืžืœื•ืœ ื”ื‘ื ื›ืฉื™ืขื•ืจ ืืงื“ืžื™ ื‘ืขื‘ืจื™ืช:\n{transcript}"
28
- summary = summarizer(transcript)[0]["summary_text"]
29
 
30
  # ืžื—ื™ืงืช ืงื•ื‘ืฅ ื”ืื•ื“ื™ื• ื‘ืžื™ื“ืช ื”ืฆื•ืจืš (ืื ื”ื™ื” ื•ื™ื“ืื•)
31
  if audio_file != file_path:
@@ -56,4 +55,4 @@ interface = gr.Interface(
56
  )
57
 
58
  if __name__ == "__main__":
59
- interface.launch()
 
23
  segments, _ = model.transcribe(audio_file, language="he")
24
  transcript = " ".join([segment.text for segment in segments])
25
 
26
+ # ืกื™ื›ื•ื ื”ืชืžืœื•ืœ ืขื ืฉื™ืžื•ืฉ ื‘-max_new_tokens
27
+ summary = summarizer(transcript, max_new_tokens=100)[0]["summary_text"]
 
28
 
29
  # ืžื—ื™ืงืช ืงื•ื‘ืฅ ื”ืื•ื“ื™ื• ื‘ืžื™ื“ืช ื”ืฆื•ืจืš (ืื ื”ื™ื” ื•ื™ื“ืื•)
30
  if audio_file != file_path:
 
55
  )
56
 
57
  if __name__ == "__main__":
58
+ interface.launch()