wasmdashai commited on
Commit
c5a603f
·
verified ·
1 Parent(s): 1ff6353

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,8 +4,9 @@ import torch
4
  import tempfile
5
  import shutil
6
  import os
7
-
8
  def text_to_speech(text):
 
9
  # 1. إنشاء مجلد مؤقت
10
  temp_model_dir = tempfile.mkdtemp()
11
 
@@ -14,6 +15,8 @@ def text_to_speech(text):
14
  tokenizer = AutoTokenizer.from_pretrained("wasmdashai/vits-ar-sa-huba-v2", cache_dir=temp_model_dir)
15
 
16
  shutil.rmtree(temp_model_dir)
 
 
17
  return temp_model_dir # Gradio سيعرض الملف الصوتي
18
 
19
 
 
4
  import tempfile
5
  import shutil
6
  import os
7
+ C=0
8
  def text_to_speech(text):
9
+ global C
10
  # 1. إنشاء مجلد مؤقت
11
  temp_model_dir = tempfile.mkdtemp()
12
 
 
15
  tokenizer = AutoTokenizer.from_pretrained("wasmdashai/vits-ar-sa-huba-v2", cache_dir=temp_model_dir)
16
 
17
  shutil.rmtree(temp_model_dir)
18
+ C+=1
19
+ print("C:",C)
20
  return temp_model_dir # Gradio سيعرض الملف الصوتي
21
 
22