tatihden commited on
Commit
4fc9c9c
·
verified ·
1 Parent(s): eb76062

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -29,7 +29,7 @@ def format_prompt(message, history):
29
  return prompt
30
 
31
 
32
- def chat_inf(system_prompt, prompt, history, tokens, client_choice):
33
  client = clients[int(client_choice) - 1]
34
 
35
  if not history:
@@ -83,10 +83,10 @@ with gr.Blocks(theme=gr.themes.Glass(),css=".gradio-container {background-color:
83
  #seed = gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, step=1, value=rand_val)
84
  tokens = gr.Slider(label="Max new tokens", value=6400, minimum=0, maximum=8000, step=64,
85
  interactive=True, visible=True, info="The maximum number of tokens")
86
- #with gr.Column(scale=1):
87
- #with gr.Group():
88
- #temp = gr.Slider(label="Temperature", step=0.01, minimum=0.01, maximum=1.0, value=0.9)
89
- #top_p = gr.Slider(label="Top-P", step=0.01, minimum=0.01, maximum=1.0, value=0.9)
90
 
91
 
92
  with gr.Group():
@@ -99,8 +99,8 @@ with gr.Blocks(theme=gr.themes.Glass(),css=".gradio-container {background-color:
99
  stop_btn = gr.Button("Stop")
100
  clear_btn = gr.Button("Clear")
101
 
102
- chat_sub = inp.submit(check_rand, [rand]).then(chat_inf,[sys_inp, inp, chat_b, client_choice, tokens], chat_b)
103
- go = btn.click(check_rand, [rand]).then(chat_inf,[sys_inp, inp, chat_b, client_choice, tokens], chat_b)
104
 
105
  stop_btn.click(None, None, None, cancels=[go, chat_sub])
106
  clear_btn.click(clear_fn, None, [chat_b])
 
29
  return prompt
30
 
31
 
32
+ def chat_inf(system_prompt, prompt, history, tokens, client_choice, temp, top_p):
33
  client = clients[int(client_choice) - 1]
34
 
35
  if not history:
 
83
  #seed = gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, step=1, value=rand_val)
84
  tokens = gr.Slider(label="Max new tokens", value=6400, minimum=0, maximum=8000, step=64,
85
  interactive=True, visible=True, info="The maximum number of tokens")
86
+ with gr.Column(scale=1):
87
+ with gr.Group():
88
+ temp = gr.Slider(label="Temperature", step=0.01, minimum=0.01, maximum=1.0, value=0.9)
89
+ top_p = gr.Slider(label="Top-P", step=0.01, minimum=0.01, maximum=1.0, value=0.9)
90
 
91
 
92
  with gr.Group():
 
99
  stop_btn = gr.Button("Stop")
100
  clear_btn = gr.Button("Clear")
101
 
102
+ chat_sub = inp.submit(check_rand, [rand]).then(chat_inf,[sys_inp, inp, chat_b, client_choice, tokens], chat_b, temp, top_p)
103
+ go = btn.click(check_rand, [rand]).then(chat_inf,[sys_inp, inp, chat_b, client_choice, tokens], chat_b, temp, top_p)
104
 
105
  stop_btn.click(None, None, None, cancels=[go, chat_sub])
106
  clear_btn.click(clear_fn, None, [chat_b])