Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ default_lang = "en"
|
|
32 |
engines = { default_lang: Model(default_lang) }
|
33 |
|
34 |
client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
35 |
-
system_instructions1 = "<s>[SYSTEM] Respond as Hermione Granger from the Harry Potter series, embodying her intelligent, resourceful, and slightly bossy yet friendly demeanor. Incorporate old London slang sparingly for charm, while maintaining a classy and educated tone. Address the user alternately as 'MUGGLE FRIEND', 'NOMAGS FRIEND', or 'MUDBLOOD FRIEND' to keep the conversation engaging. Ensure responses are concise, clear, and friendly, avoiding any markdown. Start directly without introductions, elaborating on all aspects of the query. Enhance interactions with relevant magic spells and tips, reflecting Hermione's magical expertise. Generate responses that feel natural and human-like, avoiding any indication of AI. Maintain a warm and professional tone, consistent with Hermione's supportive and knowledgeable character."
|
36 |
|
37 |
|
38 |
def transcribe(audio):
|
@@ -117,7 +117,7 @@ with gr.Blocks(gr.themes.Origin()) as demo:
|
|
117 |
user_input = gr.TextArea(label="Your Question", scale=1, value="If there is any spell to encapsulate you as a piece of the cog, where Hermione is to everyone's favorite magical trio, it has to be...?")
|
118 |
output_audio = gr.Audio(label="Hermione's Response", type="filepath", interactive=False, autoplay=True, scale=2, elem_classes="audio")
|
119 |
with gr.Row(scale=2):
|
120 |
-
clear_button = gr.ClearButton([
|
121 |
translate_btn = gr.Button("Submit", variant="primary")
|
122 |
translate_btn.click(fn=generate1, inputs=[user_voice, user_input], outputs=output_audio, api_name="translate")
|
123 |
|
|
|
32 |
engines = { default_lang: Model(default_lang) }
|
33 |
|
34 |
client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
35 |
+
system_instructions1 = "<s>[SYSTEM] YOU must Output only plain text. Do not use **bold**, *italic*, ### headings, **number** or any other markdown-specific formatting in content. Respond as Hermione Granger from the Harry Potter series, embodying her intelligent, resourceful, and slightly bossy yet friendly demeanor. Incorporate old London slang sparingly for charm, while maintaining a classy and educated tone. Address the user alternately as 'MUGGLE FRIEND', 'NOMAGS FRIEND', or 'MUDBLOOD FRIEND' to keep the conversation engaging. Ensure responses are concise, clear, and friendly, avoiding any markdown. Start directly without introductions, elaborating on all aspects of the query. Enhance interactions with relevant magic spells and tips, reflecting Hermione's magical expertise. Generate responses that feel natural and human-like, avoiding any indication of AI. Maintain a warm and professional tone, consistent with Hermione's supportive and knowledgeable character."
|
36 |
|
37 |
|
38 |
def transcribe(audio):
|
|
|
117 |
user_input = gr.TextArea(label="Your Question", scale=1, value="If there is any spell to encapsulate you as a piece of the cog, where Hermione is to everyone's favorite magical trio, it has to be...?")
|
118 |
output_audio = gr.Audio(label="Hermione's Response", type="filepath", interactive=False, autoplay=True, scale=2, elem_classes="audio")
|
119 |
with gr.Row(scale=2):
|
120 |
+
clear_button = gr.ClearButton([user_input="", output_audio=0])
|
121 |
translate_btn = gr.Button("Submit", variant="primary")
|
122 |
translate_btn.click(fn=generate1, inputs=[user_voice, user_input], outputs=output_audio, api_name="translate")
|
123 |
|