Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,13 +14,14 @@ translation_pipeline = pipeline("translation_en_to_ar", model="Helsinki-NLP/opus
|
|
| 14 |
def summarize_text_en(text):
|
| 15 |
summary = summarization_pipeline_en(
|
| 16 |
text,
|
| 17 |
-
max_length=
|
| 18 |
-
min_length=
|
| 19 |
length_penalty=2.0,
|
| 20 |
num_beams=4,
|
| 21 |
early_stopping=True
|
| 22 |
)[0]["summary_text"]
|
| 23 |
return summary
|
|
|
|
| 24 |
|
| 25 |
# 4. تحويل النص إلى صوت باستخدام gTTS
|
| 26 |
def text_to_speech(text, lang_code):
|
|
|
|
| 14 |
def summarize_text_en(text):
|
| 15 |
summary = summarization_pipeline_en(
|
| 16 |
text,
|
| 17 |
+
max_length=60, # Reduce the max length further
|
| 18 |
+
min_length=25, # Reduce the min length
|
| 19 |
length_penalty=2.0,
|
| 20 |
num_beams=4,
|
| 21 |
early_stopping=True
|
| 22 |
)[0]["summary_text"]
|
| 23 |
return summary
|
| 24 |
+
|
| 25 |
|
| 26 |
# 4. تحويل النص إلى صوت باستخدام gTTS
|
| 27 |
def text_to_speech(text, lang_code):
|