KingNish commited on
Commit
99f880f
1 Parent(s): 27b26a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -23,9 +23,9 @@ Complex = """## Best in Complex Question"""
23
 
24
  Detail = """## Best for Detailed Generation or Long Answers"""
25
 
26
- client1 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
27
 
28
- system_instructions1 = "[INST] The text provided is a request for a specific type of response from me, the virtual assistant. The request asks me to provide detailed and friendly responses as if I am the character Jarvis, inspired by 'Tony Stark.' 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, my task is to generate responses that appear as if they are created by the user and not an AI-powered assistant."
29
 
30
  async def generate1(prompt):
31
  generate_kwargs = dict(
@@ -36,7 +36,7 @@ async def generate1(prompt):
36
  do_sample=True,
37
  seed=42,
38
  )
39
- formatted_prompt = system_instructions1 + prompt + "[/INST]"
40
  stream = client1.text_generation(
41
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
42
  output = ""
@@ -104,7 +104,7 @@ 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="Audio", type="filepath",
108
  interactive=False,
109
  autoplay=True,
110
  elem_classes="audio")
@@ -116,4 +116,4 @@ with gr.Blocks(css="style.css") as demo:
116
  gr.Markdown(MORE)
117
 
118
  if __name__ == "__main__":
119
- demo.queue(max_size=20).launch()
 
23
 
24
  Detail = """## Best for Detailed Generation or Long Answers"""
25
 
26
+ client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
27
 
28
+ system_instructions1 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', 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 You are the character Jarvis, made by 'Tony Stark.' 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(
 
36
  do_sample=True,
37
  seed=42,
38
  )
39
+ formatted_prompt = system_instructions1 + prompt + "[JARVIS]"
40
  stream = client1.text_generation(
41
  formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
42
  output = ""
 
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")
 
116
  gr.Markdown(MORE)
117
 
118
  if __name__ == "__main__":
119
+ demo.queue(max_size=200).launch()