Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,10 @@ from huggingface_hub import InferenceClient
|
|
2 |
import gradio as gr
|
3 |
import random
|
4 |
import prompts
|
|
|
|
|
|
|
|
|
5 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
6 |
|
7 |
def format_prompt(message, history):
|
@@ -33,7 +37,7 @@ def generate(prompt,history,max_new_tokens,seed):
|
|
33 |
|
34 |
for response in stream:
|
35 |
output += response.token.text
|
36 |
-
yield output
|
37 |
|
38 |
additional_inputs = [
|
39 |
gr.Slider(
|
@@ -61,11 +65,12 @@ examples=[["Write a heavy metal rock song about horses (1000 words)"],
|
|
61 |
["Write a slammin rap song about about a gangster fising trip."],
|
62 |
["Use the same lyrics as above, but add more words to each verse"],
|
63 |
]
|
64 |
-
gr.ChatInterface(
|
65 |
fn=generate,
|
66 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, layout="panel"),
|
67 |
title="Song Writer",
|
68 |
additional_inputs=additional_inputs,
|
69 |
examples=examples,
|
70 |
concurrency_limit=20,
|
71 |
-
).
|
|
|
|
2 |
import gradio as gr
|
3 |
import random
|
4 |
import prompts
|
5 |
+
from pypipertts import PyPiper
|
6 |
+
pp=PyPiper()
|
7 |
+
pp.load_mod(instr="en_US-joe-medium")
|
8 |
+
|
9 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
10 |
|
11 |
def format_prompt(message, history):
|
|
|
37 |
|
38 |
for response in stream:
|
39 |
output += response.token.text
|
40 |
+
yield output,pp.stream_ttx(outpt)
|
41 |
|
42 |
additional_inputs = [
|
43 |
gr.Slider(
|
|
|
65 |
["Write a slammin rap song about about a gangster fising trip."],
|
66 |
["Use the same lyrics as above, but add more words to each verse"],
|
67 |
]
|
68 |
+
chat=gr.ChatInterface(
|
69 |
fn=generate,
|
70 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, layout="panel"),
|
71 |
title="Song Writer",
|
72 |
additional_inputs=additional_inputs,
|
73 |
examples=examples,
|
74 |
concurrency_limit=20,
|
75 |
+
).outpupt([gr.Audio()])
|
76 |
+
chat.launch(show_api=False)
|