Respair commited on
Commit
3435229
·
verified ·
1 Parent(s): 21c0d59

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +4 -5
demo.py CHANGED
@@ -7,7 +7,6 @@ from gradio_client import Client, file
7
 
8
  client = Client(os.environ['src'])
9
 
10
- # --- UI Data Loading (Client-Side) ---
11
  BASE_PATH = "Inference"
12
  RU_RANDOM_TEXTS_PATH = os.path.join(BASE_PATH, "random_texts.txt")
13
  EN_RANDOM_TEXTS_PATH = os.path.join(BASE_PATH, "english_random_texts.txt")
@@ -18,7 +17,7 @@ EN_PROMPT_TEXTS_PATH = os.path.join(BASE_PATH, "english_prompt.txt")
18
  def load_texts(filepath):
19
  if not os.path.exists(os.path.dirname(filepath)) and os.path.dirname(filepath) != '':
20
  print(f"Warning: Directory '{os.path.dirname(filepath)}' not found.")
21
- # Return a more specific default based on expected content type
22
  if "random" in filepath: return ["Default example text."]
23
  else: return ["Speaker: Default prompt text."]
24
  try:
@@ -158,9 +157,10 @@ def Client_PromptedSynth_Text(text, beta, t, diffusion_steps, embedding_scale, r
158
  return (44100, np.zeros(1))
159
 
160
 
 
161
  INTROTXT = """#
162
  Demo for The Poor Man's TTS, this is run on a single RTX 3090.
163
- Repo -> [Hugging Face - 🤗](https://huggingface.co/Respair/Project_Kanade_SpeechModel)
164
  **Check the Tips and Model Details tabs below.** <br>
165
  Enjoy!
166
  """
@@ -248,7 +248,7 @@ with gr.Blocks() as audio_inf:
248
 
249
 
250
  with gr.Blocks() as longform:
251
- gr.Markdown("### Synthesize speech using the text content itself to guide the style (semantic prompting).")
252
  with gr.Row():
253
  with gr.Column(scale=1):
254
  language_checkbox_longform = gr.Checkbox(label="English?", value=False,
@@ -440,7 +440,6 @@ app = gr.TabbedInterface(
440
 
441
  if __name__ == "__main__":
442
  print("Launching Client Gradio App...")
443
- # Add error handling for DummyClient case during launch if desired
444
  if isinstance(client, DummyClient):
445
  print("\nWARNING: Gradio Client failed to connect. The app will launch, but synthesis will not work.")
446
  print("Please ensure the backend server is running and accessible, then restart this client.\n")
 
7
 
8
  client = Client(os.environ['src'])
9
 
 
10
  BASE_PATH = "Inference"
11
  RU_RANDOM_TEXTS_PATH = os.path.join(BASE_PATH, "random_texts.txt")
12
  EN_RANDOM_TEXTS_PATH = os.path.join(BASE_PATH, "english_random_texts.txt")
 
17
  def load_texts(filepath):
18
  if not os.path.exists(os.path.dirname(filepath)) and os.path.dirname(filepath) != '':
19
  print(f"Warning: Directory '{os.path.dirname(filepath)}' not found.")
20
+
21
  if "random" in filepath: return ["Default example text."]
22
  else: return ["Speaker: Default prompt text."]
23
  try:
 
157
  return (44100, np.zeros(1))
158
 
159
 
160
+ # Repo -> [Hugging Face - 🤗](https://huggingface.co/Respair/Project_Kanade_SpeechModel)
161
  INTROTXT = """#
162
  Demo for The Poor Man's TTS, this is run on a single RTX 3090.
163
+ Repo -> [Github](https://github.com/Respaired/Project_Kalliope)
164
  **Check the Tips and Model Details tabs below.** <br>
165
  Enjoy!
166
  """
 
248
 
249
 
250
  with gr.Blocks() as longform:
251
+
252
  with gr.Row():
253
  with gr.Column(scale=1):
254
  language_checkbox_longform = gr.Checkbox(label="English?", value=False,
 
440
 
441
  if __name__ == "__main__":
442
  print("Launching Client Gradio App...")
 
443
  if isinstance(client, DummyClient):
444
  print("\nWARNING: Gradio Client failed to connect. The app will launch, but synthesis will not work.")
445
  print("Please ensure the backend server is running and accessible, then restart this client.\n")