Ebramashraf commited on
Commit
1e1aa53
·
verified ·
1 Parent(s): ec0d69b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- import speechbrain as sb
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 = sb.pretrained_models.Wav2Vec2ASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-ar")
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):