Spaces:
Runtime error
Runtime error
srbdni
commited on
Commit
•
228eb39
1
Parent(s):
6128691
Update app.py
Browse files
app.py
CHANGED
@@ -23,6 +23,28 @@ import sys
|
|
23 |
import asyncio
|
24 |
from ChatGPT_lite.ChatGPT import Chatbot
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
title = "Speech to ChatGPT to Speech"
|
27 |
#info = "more info at [Neon Coqui TTS Plugin](https://github.com/NeonGeckoCom/neon-tts-plugin-coqui), [Coqui TTS](https://github.com/coqui-ai/TTS)"
|
28 |
#badge = "https://visitor-badge-reloaded.herokuapp.com/badge?page_id=neongeckocom.neon-tts-plugin-coqui"
|
@@ -198,6 +220,8 @@ with gr.Blocks() as blocks:
|
|
198 |
text1 = gr.Textbox(label="Speech to Text")
|
199 |
text2 = gr.Textbox(label="ChatGPT Response")
|
200 |
audio = gr.Audio(label="Output", interactive=False)
|
|
|
|
|
201 |
#gr.Markdown(info)
|
202 |
#gr.Markdown("<center>"
|
203 |
# +f'<img src={badge} alt="visitors badge"/>'
|
@@ -212,4 +236,4 @@ with gr.Blocks() as blocks:
|
|
212 |
radio.change(lambda lang: CoquiTTS.langs[lang]["sentence"], radio, text2)
|
213 |
|
214 |
|
215 |
-
blocks.launch(debug=True)
|
|
|
23 |
import asyncio
|
24 |
from ChatGPT_lite.ChatGPT import Chatbot
|
25 |
|
26 |
+
import os
|
27 |
+
os.system("pip install numpy==1.23.1")
|
28 |
+
|
29 |
+
os.system("pip install gradio==2.7.5.2")
|
30 |
+
os.system("python -m pip install paddlepaddle-gpu==2.2.1.post112 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html")
|
31 |
+
os.system("hub install wav2lip==1.0.0")
|
32 |
+
import gradio as gr
|
33 |
+
import paddlehub as hub
|
34 |
+
|
35 |
+
module = hub.Module(name="wav2lip")
|
36 |
+
|
37 |
+
def inference(image,audio):
|
38 |
+
module.wav2lip_transfer(face=image, audio=audio, output_dir='.', use_gpu=False)
|
39 |
+
return "result.mp4"
|
40 |
+
|
41 |
+
title = ""
|
42 |
+
description = ""
|
43 |
+
|
44 |
+
article = ""
|
45 |
+
examples=[['monatest.jpeg',"game.wav"]]
|
46 |
+
|
47 |
+
|
48 |
title = "Speech to ChatGPT to Speech"
|
49 |
#info = "more info at [Neon Coqui TTS Plugin](https://github.com/NeonGeckoCom/neon-tts-plugin-coqui), [Coqui TTS](https://github.com/coqui-ai/TTS)"
|
50 |
#badge = "https://visitor-badge-reloaded.herokuapp.com/badge?page_id=neongeckocom.neon-tts-plugin-coqui"
|
|
|
220 |
text1 = gr.Textbox(label="Speech to Text")
|
221 |
text2 = gr.Textbox(label="ChatGPT Response")
|
222 |
audio = gr.Audio(label="Output", interactive=False)
|
223 |
+
iface = gr.Interface(inference, [gr.inputs.Image(type="filepath"),audio],
|
224 |
+
outputs=gr.outputs.Video(label="Output Video"),article=article,description=description)
|
225 |
#gr.Markdown(info)
|
226 |
#gr.Markdown("<center>"
|
227 |
# +f'<img src={badge} alt="visitors badge"/>'
|
|
|
236 |
radio.change(lambda lang: CoquiTTS.langs[lang]["sentence"], radio, text2)
|
237 |
|
238 |
|
239 |
+
blocks.launch(debug=True,cache_examples=True,enable_queue=True)
|