mohamedalgmaal commited on
Commit
b8fdc2a
ยท
verified ยท
1 Parent(s): e732d29

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -14
app.py CHANGED
@@ -70,19 +70,11 @@ def get_model(model_type="Specialized"):
70
  return current_model
71
 
72
 
73
- # Copy reference audio files to a temp dir so Gradio can serve them
74
- import shutil
75
- import tempfile
76
-
77
- _assets_dir = tempfile.mkdtemp(prefix="habibi_assets_")
78
- _src_najdi = str(files("habibi_tts").joinpath("assets/Najdi.wav"))
79
- _src_hijazi = str(files("habibi_tts").joinpath("assets/Hijazi.wav"))
80
- _src_gulf = str(files("habibi_tts").joinpath("assets/Gulf.wav"))
81
-
82
- najdi_audio = shutil.copy(_src_najdi, os.path.join(_assets_dir, "Najdi.wav"))
83
- hijazi_audio = shutil.copy(_src_hijazi, os.path.join(_assets_dir, "Hijazi.wav"))
84
- gulf_audio = shutil.copy(_src_gulf, os.path.join(_assets_dir, "Gulf.wav"))
85
- print(f"Reference audio files copied to: {_assets_dir}")
86
 
87
  najdi_text = "ุชูƒูู‰ ุทู…ู†ูŠ ุงู†ุง ุงู„ูŠูˆู… ู…ุงู†ูŠ ุจู†ุงูŠู… ูˆู„ุง ู‡ูˆ ุจุฏุงุฎู„ ุนูŠู†ูŠ ุงู„ู†ูˆู… ุงู„ูŠู† ุงุชุทู…ู† ุนู„ูŠู‡."
88
  hijazi_text = "ุงุจุบุงูƒ ุชุญู‚ู‚ ู…ุนุงู‡ ุจุณ ุจุดูƒู„ ูˆุฏูŠ ู„ุงู†ู‡ ุณู„ุทุงู† ูŠู…ุฑ ุจุธุฑูˆู ุตุนุจุฉ ุดูˆูŠุฉ."
@@ -340,4 +332,4 @@ with gr.Blocks(
340
  """
341
  )
342
 
343
- app.queue().launch(show_error=True, allowed_paths=[_assets_dir])
 
70
  return current_model
71
 
72
 
73
+ # Reference audio paths
74
+ _assets_path = str(files("habibi_tts").joinpath("assets"))
75
+ najdi_audio = str(files("habibi_tts").joinpath("assets/Najdi.wav"))
76
+ hijazi_audio = str(files("habibi_tts").joinpath("assets/Hijazi.wav"))
77
+ gulf_audio = str(files("habibi_tts").joinpath("assets/Gulf.wav"))
 
 
 
 
 
 
 
 
78
 
79
  najdi_text = "ุชูƒูู‰ ุทู…ู†ูŠ ุงู†ุง ุงู„ูŠูˆู… ู…ุงู†ูŠ ุจู†ุงูŠู… ูˆู„ุง ู‡ูˆ ุจุฏุงุฎู„ ุนูŠู†ูŠ ุงู„ู†ูˆู… ุงู„ูŠู† ุงุชุทู…ู† ุนู„ูŠู‡."
80
  hijazi_text = "ุงุจุบุงูƒ ุชุญู‚ู‚ ู…ุนุงู‡ ุจุณ ุจุดูƒู„ ูˆุฏูŠ ู„ุงู†ู‡ ุณู„ุทุงู† ูŠู…ุฑ ุจุธุฑูˆู ุตุนุจุฉ ุดูˆูŠุฉ."
 
332
  """
333
  )
334
 
335
+ app.queue().launch(show_error=True, allowed_paths=[_assets_path])