Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ from transformers import pipeline
|
|
8 |
# ืืืืจืช ืืืืื ืืชืืืื
|
9 |
model = WhisperModel("ivrit-ai/faster-whisper-v2-d4")
|
10 |
|
11 |
-
# ืืืืจืช pipeline ืืกืืืื
|
12 |
-
summarizer = pipeline("summarization", model="
|
13 |
|
14 |
def transcribe_and_summarize(file_path):
|
15 |
try:
|
@@ -23,10 +23,9 @@ 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 |
-
|
28 |
-
|
29 |
-
prompt_text = f"ืกืื ืืช ืืชืืืื ืืื ืืฉืืขืืจ ืืงืืื ืืขืืจืืช:\n{transcript}"
|
30 |
# ืืืืงืช ืงืืืฅ ืืืืืื ืืืืืช ืืฆืืจื (ืื ืืื ืืืืื)
|
31 |
if audio_file != file_path:
|
32 |
os.remove(audio_file)
|
|
|
8 |
# ืืืืจืช ืืืืื ืืชืืืื
|
9 |
model = WhisperModel("ivrit-ai/faster-whisper-v2-d4")
|
10 |
|
11 |
+
# ืืืืจืช pipeline ืืกืืืื ืขื ืืืื ืืืชืื ืืขืืจืืช
|
12 |
+
summarizer = pipeline("summarization", model="avichr/heBART")
|
13 |
|
14 |
def transcribe_and_summarize(file_path):
|
15 |
try:
|
|
|
23 |
segments, _ = model.transcribe(audio_file, language="he")
|
24 |
transcript = " ".join([segment.text for segment in segments])
|
25 |
|
26 |
+
# ืกืืืื ืืชืืืื ืขื ืืืื ืืขืืจืืช
|
27 |
+
summary = summarizer(transcript)[0]["summary_text"]
|
28 |
+
|
|
|
29 |
# ืืืืงืช ืงืืืฅ ืืืืืื ืืืืืช ืืฆืืจื (ืื ืืื ืืืืื)
|
30 |
if audio_file != file_path:
|
31 |
os.remove(audio_file)
|