Gregniuki commited on
Commit
97b3e55
·
1 Parent(s): 6eef917

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -133,6 +133,8 @@ async def main(
133
  model = None
134
  onnx_models = detect_onnx_models(models_path)
135
  lan.load_language(speaker)
 
 
136
  # speaker_selection = widgets.Dropdown(
137
  # options=[],
138
  # description=f'{lan.translate(lang, "Select speaker")}:',
@@ -160,6 +162,10 @@ async def main(
160
  # Export the audio to an MP3 file in the temporary directory
161
  # temp_audio_file = os.path.join(temp_dir, "generated_audio.mp3")
162
 
 
 
 
 
163
 
164
  # Rename the audio file based on the text input
165
  renamed_audio_file = os.path.join(temp_dir, f"{text_input}.mp3")
 
133
  model = None
134
  onnx_models = detect_onnx_models(models_path)
135
  lan.load_language(speaker)
136
+ if len(text_input)
137
+ text_input = "Enter some text to generate"
138
  # speaker_selection = widgets.Dropdown(
139
  # options=[],
140
  # description=f'{lan.translate(lang, "Select speaker")}:',
 
162
  # Export the audio to an MP3 file in the temporary directory
163
  # temp_audio_file = os.path.join(temp_dir, "generated_audio.mp3")
164
 
165
+ # Check if text_input is more than 200 characters
166
+ if len(text_input) > 200:
167
+ # Truncate text_input to 200 characters
168
+ text_input = text_input[:200]
169
 
170
  # Rename the audio file based on the text input
171
  renamed_audio_file = os.path.join(temp_dir, f"{text_input}.mp3")