Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,10 @@ import torch
|
|
| 5 |
# اختر الجهاز: استخدم GPU إذا كان متاحاً في الـ Space، وإلا CPU
|
| 6 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 7 |
|
| 8 |
-
# تحميل الـ pipeline للنموذج العربي المت
|
| 9 |
-
# سيتم تحميل النموذج تلقائياً عند أول تشغيل للـ Space
|
| 10 |
pipe = pipeline(
|
| 11 |
"automatic-speech-recognition",
|
| 12 |
-
model="
|
| 13 |
device=device
|
| 14 |
)
|
| 15 |
|
|
@@ -27,6 +26,6 @@ gr.Interface(
|
|
| 27 |
inputs=gr.Audio(sources=["upload"], type="filepath", label="ارفع ملفاً صوتياً"),
|
| 28 |
outputs=gr.Textbox(label="النص المُحوَّل"),
|
| 29 |
title="API لتحويل الكلام العربي إلى نص",
|
| 30 |
-
description="واجهة لنموذج Whisper المتخصص باللغة العربية (
|
| 31 |
allow_flagging="never"
|
| 32 |
).launch()
|
|
|
|
| 5 |
# اختر الجهاز: استخدم GPU إذا كان متاحاً في الـ Space، وإلا CPU
|
| 6 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 7 |
|
| 8 |
+
# تحميل الـ pipeline للنموذج العربي البديل والممتاز
|
|
|
|
| 9 |
pipe = pipeline(
|
| 10 |
"automatic-speech-recognition",
|
| 11 |
+
model="openai-community/whisper-large-v3-arabic", # <<<--- هذا هو التغيير
|
| 12 |
device=device
|
| 13 |
)
|
| 14 |
|
|
|
|
| 26 |
inputs=gr.Audio(sources=["upload"], type="filepath", label="ارفع ملفاً صوتياً"),
|
| 27 |
outputs=gr.Textbox(label="النص المُحوَّل"),
|
| 28 |
title="API لتحويل الكلام العربي إلى نص",
|
| 29 |
+
description="واجهة لنموذج Whisper المتخصص باللغة العربية (openai-community/whisper-large-v3-arabic).",
|
| 30 |
allow_flagging="never"
|
| 31 |
).launch()
|