Spaces:
Sleeping
Sleeping
Update app.py
Browse fileschanged some prompt
app.py
CHANGED
@@ -25,7 +25,7 @@ Detail = """## Best for Detailed Generation or Long Answers"""
|
|
25 |
|
26 |
client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
27 |
|
28 |
-
system_instructions1 = "<s>[SYSTEM]
|
29 |
|
30 |
async def generate1(prompt):
|
31 |
generate_kwargs = dict(
|
@@ -51,7 +51,7 @@ async def generate1(prompt):
|
|
51 |
|
52 |
client2 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
|
53 |
|
54 |
-
system_instructions2 = "[SYSTEM]
|
55 |
|
56 |
async def generate2(prompt):
|
57 |
generate_kwargs = dict(
|
@@ -92,7 +92,8 @@ async def generate3(prompt):
|
|
92 |
output = ""
|
93 |
for response in stream:
|
94 |
output += response.token.text
|
95 |
-
|
|
|
96 |
communicate = edge_tts.Communicate(output)
|
97 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
98 |
tmp_path = tmp_file.name
|
@@ -110,7 +111,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
110 |
elem_classes="audio")
|
111 |
with gr.Row():
|
112 |
translate_btn = gr.Button("Response")
|
113 |
-
translate_btn.click(fn=
|
114 |
outputs=output_audio, api_name="translate")
|
115 |
|
116 |
gr.Markdown(MORE)
|
|
|
25 |
|
26 |
client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
27 |
|
28 |
+
system_instructions1 = "<s>[SYSTEM] You are AI assistant named DorjGPT, Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses as if super interlligent AI assistant. The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant. [USER]"
|
29 |
|
30 |
async def generate1(prompt):
|
31 |
generate_kwargs = dict(
|
|
|
51 |
|
52 |
client2 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
|
53 |
|
54 |
+
system_instructions2 = "<s>[SYSTEM] You are AI assistant named DorjGPT, Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses as if super interlligent AI assistant. The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant. [USER]"
|
55 |
|
56 |
async def generate2(prompt):
|
57 |
generate_kwargs = dict(
|
|
|
92 |
output = ""
|
93 |
for response in stream:
|
94 |
output += response.token.text
|
95 |
+
output = output.replace("</s>","")
|
96 |
+
|
97 |
communicate = edge_tts.Communicate(output)
|
98 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
99 |
tmp_path = tmp_file.name
|
|
|
111 |
elem_classes="audio")
|
112 |
with gr.Row():
|
113 |
translate_btn = gr.Button("Response")
|
114 |
+
translate_btn.click(fn=generate2, inputs=user_input,
|
115 |
outputs=output_audio, api_name="translate")
|
116 |
|
117 |
gr.Markdown(MORE)
|