ljsabc commited on
Commit
14f3e21
1 Parent(s): 1cfb8e6

Hyperparams tuning.

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -71,7 +71,7 @@ def evaluate_stream(msg, history, temperature, top_p):
71
  history.append([msg, None])
72
 
73
  context = ""
74
- if len(history) > 5:
75
  history.pop(0)
76
 
77
  for j in range(len(history)):
@@ -112,9 +112,9 @@ with gr.Blocks() as demo:
112
  state = gr.State()
113
  with gr.Row():
114
  with gr.Column(scale=2):
115
- temp = gr.components.Slider(minimum=0, maximum=1.1, value=0.95, label="Temperature",
116
  info="温度参数,越高的温度生成的内容越丰富,但是有可能出现语法问题。")
117
- top_p = gr.components.Slider(minimum=0.5, maximum=1.0, value=0.9, label="Top-p",
118
  info="top-p参数,只输出前p>top-p的文字,越大生成的内容越丰富,但也可能出现语法问题。数字越小似乎上下文的衔接性越好。")
119
  #code = gr.Textbox(label="temp_output", info="解码器输出")
120
  #top_k = gr.components.Slider(minimum=1, maximum=200, step=1, value=25, label="Top k",
 
71
  history.append([msg, None])
72
 
73
  context = ""
74
+ if len(history) > 8:
75
  history.pop(0)
76
 
77
  for j in range(len(history)):
 
112
  state = gr.State()
113
  with gr.Row():
114
  with gr.Column(scale=2):
115
+ temp = gr.components.Slider(minimum=0, maximum=1.1, value=1.0, label="Temperature",
116
  info="温度参数,越高的温度生成的内容越丰富,但是有可能出现语法问题。")
117
+ top_p = gr.components.Slider(minimum=0.5, maximum=1.0, value=0.98, label="Top-p",
118
  info="top-p参数,只输出前p>top-p的文字,越大生成的内容越丰富,但也可能出现语法问题。数字越小似乎上下文的衔接性越好。")
119
  #code = gr.Textbox(label="temp_output", info="解码器输出")
120
  #top_k = gr.components.Slider(minimum=1, maximum=200, step=1, value=25, label="Top k",