tangzhy commited on
Commit
ce4dc04
1 Parent(s): fd88110

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -85,7 +85,7 @@ def generate(
85
  {"input_ids": input_ids},
86
  streamer=streamer,
87
  max_new_tokens=max_new_tokens,
88
- do_sample=True,
89
  top_p=top_p,
90
  top_k=top_k,
91
  temperature=temperature,
@@ -113,31 +113,31 @@ chat_interface = gr.ChatInterface(
113
  ),
114
  gr.Slider(
115
  label="Temperature",
116
- minimum=0.1,
117
  maximum=4.0,
118
  step=0.1,
119
- value=0.6,
120
  ),
121
  gr.Slider(
122
  label="Top-p (nucleus sampling)",
123
  minimum=0.05,
124
  maximum=1.0,
125
  step=0.05,
126
- value=0.9,
127
  ),
128
  gr.Slider(
129
  label="Top-k",
130
  minimum=1,
131
  maximum=1000,
132
  step=1,
133
- value=50,
134
  ),
135
  gr.Slider(
136
  label="Repetition penalty",
137
  minimum=1.0,
138
  maximum=2.0,
139
  step=0.05,
140
- value=1.2,
141
  ),
142
  ],
143
  stop_btn=None,
 
85
  {"input_ids": input_ids},
86
  streamer=streamer,
87
  max_new_tokens=max_new_tokens,
88
+ do_sample=False if temperature == 0.0 else True,
89
  top_p=top_p,
90
  top_k=top_k,
91
  temperature=temperature,
 
113
  ),
114
  gr.Slider(
115
  label="Temperature",
116
+ minimum=0.0,
117
  maximum=4.0,
118
  step=0.1,
119
+ value=0.0,
120
  ),
121
  gr.Slider(
122
  label="Top-p (nucleus sampling)",
123
  minimum=0.05,
124
  maximum=1.0,
125
  step=0.05,
126
+ value=0.95,
127
  ),
128
  gr.Slider(
129
  label="Top-k",
130
  minimum=1,
131
  maximum=1000,
132
  step=1,
133
+ value=20,
134
  ),
135
  gr.Slider(
136
  label="Repetition penalty",
137
  minimum=1.0,
138
  maximum=2.0,
139
  step=0.05,
140
+ value=1.0,
141
  ),
142
  ],
143
  stop_btn=None,