Deep50D commited on
Commit
bb6167b
·
verified ·
1 Parent(s): 6f98ffd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -8,6 +8,7 @@ import gradio as gr
8
  from TTS.api import TTS
9
  from TTS.utils.manage import ModelManager
10
 
 
11
  from TTS.tts.configs.xtts_config import XttsConfig
12
  from TTS.tts.models.xtts import XttsAudioConfig
13
  from TTS.config.shared_configs import BaseDatasetConfig
@@ -87,7 +88,7 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree, req
87
  language = "fr-fr"
88
  if m.find("/fr/") != -1:
89
  language = None
90
- output_path = os.path.abspath("output.wav") # absolute path
91
  tts.tts_to_file(
92
  text=prompt,
93
  file_path=output_path,
@@ -103,18 +104,18 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree, req
103
  else:
104
  raise e
105
 
106
- # Verify file exists before returning
107
  if not os.path.exists(output_path):
108
  gr.Warning("Audio file was not created successfully")
109
  return None
110
 
111
- return output_path # return absolute path as string
112
 
113
  else:
114
  gr.Warning("Please accept the Terms & Condition!")
115
  return None
116
 
117
- title = "XTTS Deep50D's remake of Glz's remake (Functional TTS)"
118
 
119
  description = f"""
120
  <p><a href="https://huggingface.co/coqui/XTTS-v1">XTTS</a> is a Voice generation model that lets you clone voices into different languages by using just a quick 3-second audio clip.
@@ -126,9 +127,10 @@ Leave a star on the Github <a href="https://github.com/coqui-ai/TTS">TTS</a>, wh
126
  <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
127
  </p>
128
  <p>
129
- As a reminder, sending illegal content (se*ual, offensive or threatening content) in any language is, of course, FORBIDDEN.
130
  The authors of this space cannot be held responsible for those who violate the strictly [ETHICAL AND MORAL] use of this model.
131
  </p>
 
132
  """
133
 
134
  article = """
 
8
  from TTS.api import TTS
9
  from TTS.utils.manage import ModelManager
10
 
11
+ # implemented torch cereal with milk for safe globals
12
  from TTS.tts.configs.xtts_config import XttsConfig
13
  from TTS.tts.models.xtts import XttsAudioConfig
14
  from TTS.config.shared_configs import BaseDatasetConfig
 
88
  language = "fr-fr"
89
  if m.find("/fr/") != -1:
90
  language = None
91
+ output_path = os.path.abspath("output.wav") # we use that absolute path now!
92
  tts.tts_to_file(
93
  text=prompt,
94
  file_path=output_path,
 
104
  else:
105
  raise e
106
 
107
+ # better verify file exists before returning
108
  if not os.path.exists(output_path):
109
  gr.Warning("Audio file was not created successfully")
110
  return None
111
 
112
+ return output_path # return that absolute path as string
113
 
114
  else:
115
  gr.Warning("Please accept the Terms & Condition!")
116
  return None
117
 
118
+ title = "XTTS Deep50D's fixed Glz remake (Functional Text-to-Speech)"
119
 
120
  description = f"""
121
  <p><a href="https://huggingface.co/coqui/XTTS-v1">XTTS</a> is a Voice generation model that lets you clone voices into different languages by using just a quick 3-second audio clip.
 
127
  <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
128
  </p>
129
  <p>
130
+ Sending illegal content of any kind, in any language is, of course, FORBIDDEN.
131
  The authors of this space cannot be held responsible for those who violate the strictly [ETHICAL AND MORAL] use of this model.
132
  </p>
133
+ <p>Fixed stuff to make this thing work again and corrected some other things. Possibly still a bunch to fix or reinstate, or something like that xDeep50D</p>
134
  """
135
 
136
  article = """