silveroxides commited on
Commit
8fdacb9
1 Parent(s): 138353f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -58
app.py CHANGED
@@ -213,64 +213,64 @@ with gr.Blocks(css="style.css") as demo:
213
  clear_chat_button = gr.Button("Clear")
214
  chat_button = gr.Button("Submit", variant="primary")
215
  with gr.Accordion(label="Advanced settings", open=False):
216
- text_decoding_method = gr.Radio(
217
- label="Text Decoding Method",
218
- choices=["Beam search", "Nucleus sampling"],
219
- value="Nucleus sampling",
220
- )
221
- temperature = gr.Slider(
222
- label="Temperature",
223
- info="Used with nucleus sampling.",
224
- minimum=0.5,
225
- maximum=1.0,
226
- step=0.1,
227
- value=1.0,
228
- )
229
- length_penalty = gr.Slider(
230
- label="Length Penalty",
231
- info="Set to larger for longer sequence, used with beam search.",
232
- minimum=-1.0,
233
- maximum=2.0,
234
- step=0.2,
235
- value=1.0,
236
- )
237
- repetition_penalty = gr.Slider(
238
- label="Repetition Penalty",
239
- info="Larger value prevents repetition.",
240
- minimum=1.0,
241
- maximum=5.0,
242
- step=0.5,
243
- value=1.5,
244
- )
245
- max_length = gr.Slider(
246
- label="Max Length",
247
- minimum=20,
248
- maximum=512,
249
- step=1,
250
- value=50,
251
- )
252
- min_length = gr.Slider(
253
- label="Minimum Length",
254
- minimum=1,
255
- maximum=100,
256
- step=1,
257
- value=1,
258
- )
259
- num_beams = gr.Slider(
260
- label="Number of Beams",
261
- minimum=1,
262
- maximum=10,
263
- step=1,
264
- value=5,
265
- )
266
- top_p = gr.Slider(
267
- label="Top P",
268
- info="Used with nucleus sampling.",
269
- minimum=0.5,
270
- maximum=1.0,
271
- step=0.1,
272
- value=0.9,
273
- )
274
  with gr.Tab(label="Batch Image"):
275
  with gr.Group():
276
  batch_images = gr.Gallery(label="Upload Images").style(grid=[2], height=200)
 
213
  clear_chat_button = gr.Button("Clear")
214
  chat_button = gr.Button("Submit", variant="primary")
215
  with gr.Accordion(label="Advanced settings", open=False):
216
+ text_decoding_method = gr.Radio(
217
+ label="Text Decoding Method",
218
+ choices=["Beam search", "Nucleus sampling"],
219
+ value="Nucleus sampling",
220
+ )
221
+ temperature = gr.Slider(
222
+ label="Temperature",
223
+ info="Used with nucleus sampling.",
224
+ minimum=0.5,
225
+ maximum=1.0,
226
+ step=0.1,
227
+ value=1.0,
228
+ )
229
+ length_penalty = gr.Slider(
230
+ label="Length Penalty",
231
+ info="Set to larger for longer sequence, used with beam search.",
232
+ minimum=-1.0,
233
+ maximum=2.0,
234
+ step=0.2,
235
+ value=1.0,
236
+ )
237
+ repetition_penalty = gr.Slider(
238
+ label="Repetition Penalty",
239
+ info="Larger value prevents repetition.",
240
+ minimum=1.0,
241
+ maximum=5.0,
242
+ step=0.5,
243
+ value=1.5,
244
+ )
245
+ max_length = gr.Slider(
246
+ label="Max Length",
247
+ minimum=20,
248
+ maximum=512,
249
+ step=1,
250
+ value=50,
251
+ )
252
+ min_length = gr.Slider(
253
+ label="Minimum Length",
254
+ minimum=1,
255
+ maximum=100,
256
+ step=1,
257
+ value=1,
258
+ )
259
+ num_beams = gr.Slider(
260
+ label="Number of Beams",
261
+ minimum=1,
262
+ maximum=10,
263
+ step=1,
264
+ value=5,
265
+ )
266
+ top_p = gr.Slider(
267
+ label="Top P",
268
+ info="Used with nucleus sampling.",
269
+ minimum=0.5,
270
+ maximum=1.0,
271
+ step=0.1,
272
+ value=0.9,
273
+ )
274
  with gr.Tab(label="Batch Image"):
275
  with gr.Group():
276
  batch_images = gr.Gallery(label="Upload Images").style(grid=[2], height=200)