Spaces:
Runtime error
Runtime error
import gradio as gr | |
import os | |
import shlex | |
import random | |
os.system("megadl https://mega.nz/folder/7d4xUIIa#TnvmAWa5Av7QGo6gAuQj7g") | |
os.system("ls") | |
def inference(text): | |
os.system("python demo_cli.py --no_sound --cpu --text " + shlex.quote(text.strip())) | |
image_number = random.randint(2, len(os.listdir("images/"))) | |
return [f"images/{image_number}.gif", "demo_output_1.wav"] | |
title = "Neil Breen Voice" | |
description = "<center> Text-to-speech engine with Neil Breen's voice. </center>" | |
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>" | |
examples = [ | |
["Hello Red Letter Media - it's cinema's most prominent director Neil Breen. "], | |
[ | |
"Star Wars: Episode One - The Phantom Menace - is the most disappointing thing since my son" | |
], | |
["I want that juicy shack meat."], | |
["Who Am I? - What Am I? - "], | |
[ | |
"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." | |
], | |
[ | |
"I sexually Identify as an Attack Helicopter. \n" | |
".\n" | |
"Ever since I was a boy I dreamed of soaring over the oilfields dropping hot sticky loads on disgusting foreigners. \n" | |
".\n" | |
"People say to me that a person being a helicopter is Impossible, and I'm fucking retarded." | |
], | |
[ | |
"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. " | |
], | |
] | |
gr.Interface( | |
inference, | |
inputs=["text"], | |
outputs=[ | |
gr.Image(show_label=False, shape=(20, 20), value="images/1.gif"), | |
gr.outputs.Audio(type="file", label="Speech"), | |
], | |
enable_queue=True, | |
title=title, | |
description=description, | |
article=article, | |
examples=examples, | |
thumbnail="breen.jpg", | |
).launch() | |