tatihden commited on
Commit
7c44984
·
verified ·
1 Parent(s): d412457

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -67,7 +67,7 @@ def check_rand(inp, val):
67
  return gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, value=int(val))
68
 
69
 
70
- with gr.Blocks() as app:
71
  gr.HTML(
72
  """<center><h1 style='font-size:xx-large;'>CalmChat</h1></center>""")
73
  with gr.Group():
@@ -87,7 +87,7 @@ with gr.Blocks() as app:
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
- rep_p = gr.Slider(label="Repetition Penalty", step=0.1, minimum=0.1, maximum=2.0, value=1.0)
91
 
92
  with gr.Group():
93
  with gr.Row():
@@ -99,12 +99,10 @@ with gr.Blocks() as app:
99
  stop_btn = gr.Button("Stop")
100
  clear_btn = gr.Button("Clear")
101
 
102
- #chat_sub = inp.submit(check_rand, [rand, seed], seed).then(chat_inf,
103
- #[sys_inp, inp, chat_b, client_choice, seed, temp, tokens,
104
- #top_p, rep_p], chat_b)
105
- #go = btn.click(check_rand, [rand, seed], seed).then(chat_inf,
106
- #[sys_inp, inp, chat_b, client_choice, seed, temp, tokens, top_p,
107
- #rep_p], chat_b)
108
- #stop_btn.click(None, None, None, cancels=[go, chat_sub])
109
  clear_btn.click(clear_fn, None, [chat_b])
110
  app.queue(default_concurrency_limit=10).launch()
 
67
  return gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, value=int(val))
68
 
69
 
70
+ with gr.Blocks(theme=gr.themes.Glass(),css=".gradio-container {background-color: rgb(134 239 172)}") as app:
71
  gr.HTML(
72
  """<center><h1 style='font-size:xx-large;'>CalmChat</h1></center>""")
73
  with gr.Group():
 
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
+ #rep_p = gr.Slider(label="Repetition Penalty", step=0.1, minimum=0.1, maximum=2.0, value=1.0)
91
 
92
  with gr.Group():
93
  with gr.Row():
 
99
  stop_btn = gr.Button("Stop")
100
  clear_btn = gr.Button("Clear")
101
 
102
+ chat_sub = inp.submit(check_rand, [rand]).then(chat_inf,
103
+ [sys_inp, inp, chat_b, client_choice, temp, tokens, top_p], chat_b)
104
+ go = btn.click(check_rand, [rand, seed], seed).then(chat_inf,
105
+ [sys_inp, inp, chat_b, client_choice, temp, tokens, top_p], chat_b)
106
+ stop_btn.click(None, None, None, cancels=[go, chat_sub])
 
 
107
  clear_btn.click(clear_fn, None, [chat_b])
108
  app.queue(default_concurrency_limit=10).launch()