Spaces:
Sleeping
Sleeping
Ankit Yadav commited on
Commit ·
1428efb
1
Parent(s): 38575dc
Jarvis Model
Browse files
app.py
CHANGED
|
@@ -43,11 +43,11 @@ async def generate1(prompt):
|
|
| 43 |
for response in stream:
|
| 44 |
output += response.token.text
|
| 45 |
|
| 46 |
-
communicate = edge_tts.Communicate(output)
|
| 47 |
-
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
yield
|
| 51 |
|
| 52 |
client2 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
|
| 53 |
|
|
@@ -104,13 +104,15 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 104 |
with gr.Row():
|
| 105 |
user_input = gr.Textbox(label="Prompt", value="What is Wikipedia")
|
| 106 |
input_text = gr.Textbox(label="Input Text", elem_id="important")
|
|
|
|
| 107 |
# output_audio = gr.Audio(label="JARVIS", type="filepath",
|
| 108 |
# interactive=False,
|
| 109 |
# autoplay=True,
|
| 110 |
# elem_classes="audio")
|
| 111 |
with gr.Row():
|
| 112 |
translate_btn = gr.Button("Response")
|
| 113 |
-
translate_btn.click(fn=generate1, inputs=user_input,
|
|
|
|
| 114 |
|
| 115 |
gr.Markdown(MORE)
|
| 116 |
|
|
|
|
| 43 |
for response in stream:
|
| 44 |
output += response.token.text
|
| 45 |
|
| 46 |
+
# communicate = edge_tts.Communicate(output)
|
| 47 |
+
# with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
| 48 |
+
# tmp_path = tmp_file.name
|
| 49 |
+
# await communicate.save(tmp_path)
|
| 50 |
+
yield output
|
| 51 |
|
| 52 |
client2 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
|
| 53 |
|
|
|
|
| 104 |
with gr.Row():
|
| 105 |
user_input = gr.Textbox(label="Prompt", value="What is Wikipedia")
|
| 106 |
input_text = gr.Textbox(label="Input Text", elem_id="important")
|
| 107 |
+
output_text = gr.Textbox(label="Output")
|
| 108 |
# output_audio = gr.Audio(label="JARVIS", type="filepath",
|
| 109 |
# interactive=False,
|
| 110 |
# autoplay=True,
|
| 111 |
# elem_classes="audio")
|
| 112 |
with gr.Row():
|
| 113 |
translate_btn = gr.Button("Response")
|
| 114 |
+
translate_btn.click(fn=generate1, inputs=user_input,
|
| 115 |
+
outputs=output_text, api_name="translate")
|
| 116 |
|
| 117 |
gr.Markdown(MORE)
|
| 118 |
|