merve HF staff commited on
Commit
07a79a0
·
verified ·
1 Parent(s): c25614a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -87,15 +87,16 @@ with gr.Blocks(fill_height=False) as demo:
87
  submit_btn = gr.Button("Submit")
88
  output = gr.Textbox(label="Output")
89
 
90
-
 
91
 
92
  with gr.Accordion(label="Advanced Generation Parameters", open=False):
93
  examples=[
94
- ["example_images/rococo.jpg", "What art era is this?", "", "Greedy", 0.4, 512, 1.2, 0.8],
95
- ["example_images/examples_wat_arun.jpg", "Give me travel tips for the area around this monument.", "", "Greedy", 0.4, 512, 1.2, 0.8],
96
- ["example_images/examples_invoice.png", "What is the due date and the invoice date?", "", "Greedy", 0.4, 512, 1.2, 0.8],
97
- ["example_images/s2w_example.png", "What is this UI about?", "", "Greedy", 0.4, 512, 1.2, 0.8],
98
- ["example_images/examples_weather_events.png", "Where do the severe droughts happen according to this diagram?", "", "Greedy", 0.4, 512, 1.2, 0.8],
99
  ]
100
  # Hyper-parameters for generation
101
  max_new_tokens = gr.Slider(
@@ -135,10 +136,11 @@ with gr.Blocks(fill_height=False) as demo:
135
  )
136
  decoding_strategy = gr.Radio(
137
  [
138
- "Greedy",
139
  "Top P Sampling",
 
 
140
  ],
141
- value="Greedy",
142
  label="Decoding strategy",
143
  interactive=True,
144
  info="Higher values is equivalent to sampling more low-probability tokens.",
 
87
  submit_btn = gr.Button("Submit")
88
  output = gr.Textbox(label="Output")
89
 
90
+ temperature, max_new_tokens,
91
+ repetition_penalty, top_p
92
 
93
  with gr.Accordion(label="Advanced Generation Parameters", open=False):
94
  examples=[
95
+ ["example_images/rococo.jpg", "What art era is this?", "", "TopP Sampling", 0.4, 512, 1.2, 0.8],
96
+ ["example_images/examples_wat_arun.jpg", "Give me travel tips for the area around this monument.", "", "Top P Sampling", 0.4, 512, 1.2, 0.8],
97
+ ["example_images/examples_invoice.png", "What is the due date and the invoice date?", "", "Top P Sampling", 0.4, 512, 1.2, 0.8],
98
+ ["example_images/s2w_example.png", "What is this UI about?", "", "Top P Sampling", 0.4, 512, 1.2, 0.8],
99
+ ["example_images/examples_weather_events.png", "Where do the severe droughts happen according to this diagram?", "", "Top P Sampling", 0.4, 512, 1.2, 0.8],
100
  ]
101
  # Hyper-parameters for generation
102
  max_new_tokens = gr.Slider(
 
136
  )
137
  decoding_strategy = gr.Radio(
138
  [
 
139
  "Top P Sampling",
140
+ "Greedy",
141
+
142
  ],
143
+ value="Top P Sampling",
144
  label="Decoding strategy",
145
  interactive=True,
146
  info="Higher values is equivalent to sampling more low-probability tokens.",