offiongbassey commited on
Commit
4fc0704
·
verified ·
1 Parent(s): ebd2efe

Update app

Browse files
Files changed (1) hide show
  1. app.py +0 -12
app.py CHANGED
@@ -53,8 +53,6 @@ MODEL_ARCH = os.environ.get("F5TTS_ARCH", "F5TTS_v1_Base")
53
 
54
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
55
 
56
- MAX_GEN_CHARS = 600 # keep generations bounded on CPU
57
-
58
 
59
  _model_lock = threading.Lock()
60
  _tts_model = None
@@ -121,11 +119,6 @@ def get_model():
121
  def generate_default_voice(text: str, speed: float, nfe_steps: int):
122
  if not text or not text.strip():
123
  raise gr.Error("Please enter some text to generate speech for.")
124
- if len(text) > MAX_GEN_CHARS:
125
- raise gr.Error(
126
- f"Text is too long ({len(text)} characters). "
127
- f"Please keep it under {MAX_GEN_CHARS} characters on this CPU Space."
128
- )
129
 
130
  model, ref_audio, ref_text = get_model()
131
 
@@ -153,11 +146,6 @@ def generate_cloned_voice(
153
  raise gr.Error("Please upload a reference voice clip first.")
154
  if not gen_text or not gen_text.strip():
155
  raise gr.Error("Please enter the text you want spoken in the cloned voice.")
156
- if len(gen_text) > MAX_GEN_CHARS:
157
- raise gr.Error(
158
- f"Text is too long ({len(gen_text)} characters). "
159
- f"Please keep it under {MAX_GEN_CHARS} characters on this CPU Space."
160
- )
161
 
162
  model, _, _ = get_model()
163
 
 
53
 
54
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
55
 
 
 
56
 
57
  _model_lock = threading.Lock()
58
  _tts_model = None
 
119
  def generate_default_voice(text: str, speed: float, nfe_steps: int):
120
  if not text or not text.strip():
121
  raise gr.Error("Please enter some text to generate speech for.")
 
 
 
 
 
122
 
123
  model, ref_audio, ref_text = get_model()
124
 
 
146
  raise gr.Error("Please upload a reference voice clip first.")
147
  if not gen_text or not gen_text.strip():
148
  raise gr.Error("Please enter the text you want spoken in the cloned voice.")
 
 
 
 
 
149
 
150
  model, _, _ = get_model()
151