2506minecraft commited on
Commit
c51d569
·
verified ·
1 Parent(s): 8e1af04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -32,8 +32,8 @@ try:
32
  token=os.getenv("HF_TOKEN")
33
  )
34
 
35
- # 2. نموذج توليف الصوت (نموذج بديل)
36
- tts_pipeline = pipeline("text-to-speech", model="coqui/tts-arabic", token=os.getenv("HF_TOKEN"))
37
 
38
  except Exception as e:
39
  logger.error(f"فشل تحميل النماذج: {str(e)}")
@@ -112,10 +112,10 @@ async def process_voice(update: Update, context):
112
  return
113
 
114
  bot_response = await generate_response(user_text, str(user_id))
115
- await text_to_speech(bot_response)
116
 
117
  if enhance_audio("bot_response.wav", "bot_response_enhanced.wav"):
118
- await update.message.reply_voice("bot_response_enh hanced.wav")
119
  else:
120
  await update.message.reply_voice("bot_response.wav")
121
 
 
32
  token=os.getenv("HF_TOKEN")
33
  )
34
 
35
+ # 2. نموذج توليف الصوت
36
+ tts_pipeline = pipeline("text-to-speech", model="mohamedhossam/arabic-tts", token=os.getenv("HF_TOKEN"))
37
 
38
  except Exception as e:
39
  logger.error(f"فشل تحميل النماذج: {str(e)}")
 
112
  return
113
 
114
  bot_response = await generate_response(user_text, str(user_id))
115
+ await text_to speech(bot_response)
116
 
117
  if enhance_audio("bot_response.wav", "bot_response_enhanced.wav"):
118
+ await update.message.reply_voice("bot_response_enhanced.wav")
119
  else:
120
  await update.message.reply_voice("bot_response.wav")
121