Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from diffusers import StableDiffusionPipeline
|
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
-
|
8 |
|
9 |
# ✅ تحميل نموذج المحادثة (GPT-like)
|
10 |
chat_model = pipeline("text-generation", model="akhooli/gpt2-small-arabic")
|
@@ -20,7 +20,7 @@ vision_pipe = pipeline("image-classification", model="microsoft/resnet-50")
|
|
20 |
ocr_pipe = pipeline("image-to-text", model="microsoft/trocr-base-printed")
|
21 |
|
22 |
# ✅ تحميل نموذج تحويل الكلام إلى نص (STT)
|
23 |
-
asr_pipe =
|
24 |
|
25 |
# ✅ دالة المحادثة
|
26 |
def chat(user_input):
|
|
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
+
from speechbrain.pretrained import EncoderASR # تم التعديل هنا
|
8 |
|
9 |
# ✅ تحميل نموذج المحادثة (GPT-like)
|
10 |
chat_model = pipeline("text-generation", model="akhooli/gpt2-small-arabic")
|
|
|
20 |
ocr_pipe = pipeline("image-to-text", model="microsoft/trocr-base-printed")
|
21 |
|
22 |
# ✅ تحميل نموذج تحويل الكلام إلى نص (STT)
|
23 |
+
asr_pipe = EncoderASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-ar", savedir="pretrained_models/asr-wav2vec2-commonvoice-ar") # تم التعديل هنا
|
24 |
|
25 |
# ✅ دالة المحادثة
|
26 |
def chat(user_input):
|