Spaces:
Runtime error
Runtime error
Initial commit
Browse files- README.md +4 -4
- app.py +17 -16
- demo_cli.py +2 -1
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.1.4
|
8 |
app_file: app.py
|
|
|
1 |
---
|
2 |
+
title: Pat NES Punk
|
3 |
+
emoji: 👾
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: blue
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.1.4
|
8 |
app_file: app.py
|
app.py
CHANGED
@@ -9,30 +9,32 @@ os.system("ls")
|
|
9 |
|
10 |
def inference(text):
|
11 |
os.system("python demo_cli.py --no_sound --cpu --text " + shlex.quote(text.strip()))
|
12 |
-
image_number = random.randint(2, len(os.listdir("
|
13 |
-
return [f"
|
14 |
|
15 |
|
16 |
-
title = "
|
17 |
-
description = "<center> Text-to-speech engine with
|
18 |
article = "<p style='text-align: center'>Based on <a href='https://matheo.uliege.be/handle/2268.2/6801' target='_blank'>Real-Time Voice Cloning</a> | <a href='https://github.com/CorentinJ/Real-Time-Voice-Cloning' target='_blank'>Github Repo</a></p>"
|
19 |
|
20 |
examples = [
|
21 |
-
["Hello Red Letter Media - it's cinema's most prominent director Neil Breen. "],
|
22 |
[
|
23 |
"Star Wars: Episode One - The Phantom Menace - is the most disappointing thing since my son"
|
24 |
],
|
25 |
-
["I want that juicy shack meat."],
|
26 |
-
["Who Am I? - What Am I? - "],
|
27 |
[
|
28 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
],
|
30 |
[
|
31 |
-
"I
|
32 |
-
".\n"
|
33 |
-
"Ever since I was a boy I dreamed of soaring over the oilfields dropping hot sticky loads on disgusting foreigners. \n"
|
34 |
-
".\n"
|
35 |
-
"People say to me that a person being a helicopter is Impossible, and I'm fucking retarded."
|
36 |
],
|
37 |
[
|
38 |
"To be fair, you have to have a very high IQ to understand Rick and Morty. The humour is extremely subtle, and without a solid grasp of theoretical physics most of the jokes will go over a typical viewer's head. There's also Rick's nihilistic outlook, which is deftly woven into his characterisation. "
|
@@ -42,13 +44,12 @@ gr.Interface(
|
|
42 |
inference,
|
43 |
inputs=["text"],
|
44 |
outputs=[
|
45 |
-
gr.Image(show_label=False, shape=(20, 20), value="
|
46 |
gr.outputs.Audio(type="file", label="Speech"),
|
47 |
],
|
48 |
enable_queue=True,
|
49 |
title=title,
|
50 |
description=description,
|
51 |
article=article,
|
52 |
-
examples=examples
|
53 |
-
thumbnail="breen.jpg",
|
54 |
).launch()
|
|
|
9 |
|
10 |
def inference(text):
|
11 |
os.system("python demo_cli.py --no_sound --cpu --text " + shlex.quote(text.strip()))
|
12 |
+
image_number = random.randint(2, len(os.listdir("pat_gifs/")))
|
13 |
+
return [f"pat_gifs/{image_number}.gif", "demo_output_1.wav"]
|
14 |
|
15 |
|
16 |
+
title = "Pat NES Punk's Voice"
|
17 |
+
description = "<center> Text-to-speech engine with Pat Contri's voice. </center>"
|
18 |
article = "<p style='text-align: center'>Based on <a href='https://matheo.uliege.be/handle/2268.2/6801' target='_blank'>Real-Time Voice Cloning</a> | <a href='https://github.com/CorentinJ/Real-Time-Voice-Cloning' target='_blank'>Github Repo</a></p>"
|
19 |
|
20 |
examples = [
|
|
|
21 |
[
|
22 |
"Star Wars: Episode One - The Phantom Menace - is the most disappointing thing since my son"
|
23 |
],
|
|
|
|
|
24 |
[
|
25 |
+
"My name is Samantha Morris. I'm the editor of an internet news magazine exploring news most media shy away from."
|
26 |
+
],
|
27 |
+
[
|
28 |
+
'I have a morning ritual that I need to share. I call it "the terminator". First I crouch down in the shower in the classic "naked terminator traveling through time" pose.'
|
29 |
+
],
|
30 |
+
[
|
31 |
+
'With my eyes closed I crouch there for a minute, visualizing either Arnold or the guy from the second movie (not the chick in the third one because that one sucked) and I start to hum the terminator theme.'
|
32 |
+
],
|
33 |
+
[
|
34 |
+
'Then I slowly rise to a standing position and open my eyes. It helps me to proceed through my day as an emotionless, cyborg badass. The only problem is if the shower curtain sticks to my terminator leg. It ruins the fantasy.'
|
35 |
],
|
36 |
[
|
37 |
+
"Okay, hear me out. So it's about this guy named Rick. He's a scientist that turns himself into a pickle. Funniest thing I've seen. In the episode Rick's grandson, Morty flips over a talking pickle. And its Rick! It's the funniest thing."
|
|
|
|
|
|
|
|
|
38 |
],
|
39 |
[
|
40 |
"To be fair, you have to have a very high IQ to understand Rick and Morty. The humour is extremely subtle, and without a solid grasp of theoretical physics most of the jokes will go over a typical viewer's head. There's also Rick's nihilistic outlook, which is deftly woven into his characterisation. "
|
|
|
44 |
inference,
|
45 |
inputs=["text"],
|
46 |
outputs=[
|
47 |
+
gr.Image(show_label=False, shape=(20, 20), value="pat_gifs/1.gif"),
|
48 |
gr.outputs.Audio(type="file", label="Speech"),
|
49 |
],
|
50 |
enable_queue=True,
|
51 |
title=title,
|
52 |
description=description,
|
53 |
article=article,
|
54 |
+
examples=examples
|
|
|
55 |
).launch()
|
demo_cli.py
CHANGED
@@ -142,7 +142,7 @@ if __name__ == '__main__':
|
|
142 |
# The following two methods are equivalent:
|
143 |
# - Directly load from the filepath:
|
144 |
|
145 |
-
with open('
|
146 |
preprocessed_wav = pickle.load(handle)
|
147 |
# - If the wav is already loaded:
|
148 |
|
@@ -198,3 +198,4 @@ if __name__ == '__main__':
|
|
198 |
print(generated_wav.dtype)
|
199 |
sf.write(filename, generated_wav.astype(np.float32), synthesizer.sample_rate)
|
200 |
print("\nSaved output as %s\n\n" % filename)
|
|
|
|
142 |
# The following two methods are equivalent:
|
143 |
# - Directly load from the filepath:
|
144 |
|
145 |
+
with open('pat.pickle', 'rb') as handle:
|
146 |
preprocessed_wav = pickle.load(handle)
|
147 |
# - If the wav is already loaded:
|
148 |
|
|
|
198 |
print(generated_wav.dtype)
|
199 |
sf.write(filename, generated_wav.astype(np.float32), synthesizer.sample_rate)
|
200 |
print("\nSaved output as %s\n\n" % filename)
|
201 |
+
print(os.environ)
|