broadfield commited on
Commit
5f8069c
·
verified ·
1 Parent(s): 6ae48e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -9,16 +9,15 @@ pp=PyPiper()
9
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
10
 
11
  def format_prompt(message, history):
12
-
13
  prompt = "<s>"
14
  for user_prompt, bot_response in history:
15
- print (bot_response)
16
  prompt += f"[INST] {user_prompt} [/INST]"
17
  prompt += f" {bot_response}</s> "
18
  prompt += f"[INST] {message} [/INST]"
19
  return prompt
20
 
21
- def generate(prompt,history,max_new_tokens,seed):
22
  seed = random.randint(1,9999999999999)
23
  print(seed)
24
  system_prompt = prompts.ASSISTANT
@@ -58,10 +57,9 @@ with gr.Blocks() as iface:
58
  with gr.Row():
59
  submit_b = gr.Button()
60
  stop_b = gr.Button("Stop")
61
- clear = gr.ClearButton([msg, chatbot])
62
  with gr.Accordion("Voice Controls",open=False):
63
  msg = gr.HTML("""""")
64
-
65
  names=gr.Dropdown(label="Voice", choices=pp.key_list,value="en_US-joe-medium")
66
  length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
67
  noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=0.5)
 
9
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
10
 
11
  def format_prompt(message, history):
 
12
  prompt = "<s>"
13
  for user_prompt, bot_response in history:
14
+ #print (bot_response)
15
  prompt += f"[INST] {user_prompt} [/INST]"
16
  prompt += f" {bot_response}</s> "
17
  prompt += f"[INST] {message} [/INST]"
18
  return prompt
19
 
20
+ def generate(prompt,history):
21
  seed = random.randint(1,9999999999999)
22
  print(seed)
23
  system_prompt = prompts.ASSISTANT
 
57
  with gr.Row():
58
  submit_b = gr.Button()
59
  stop_b = gr.Button("Stop")
60
+ clear = gr.ClearButton([chatbot])
61
  with gr.Accordion("Voice Controls",open=False):
62
  msg = gr.HTML("""""")
 
63
  names=gr.Dropdown(label="Voice", choices=pp.key_list,value="en_US-joe-medium")
64
  length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
65
  noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=0.5)