ifire commited on
Commit
3cd7c47
1 Parent(s): 923a6bf

Update prompt text and default values for model parameters

Browse files

- Updated the prompt text in the app to ask users to describe what they see.
- Changed the default value for max length slider from 250 to 500.
- Changed the default value for text decoding method radio button from "Nucleus sampling" to "Beam search".
- Changed the default value for top p slider from 0.2 to 0.9.
- Changed the default value for beam size slider from 5 to 10.
- Changed the default value for length penalty slider from 1 to 0.4.
- Changed the default value for repetition penalty slider from 1 to 5.

Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -60,7 +60,7 @@ with gr.Blocks(theme=theme, analytics_enabled=False,css=css) as demo:
60
  with gr.Row():
61
  with gr.Column(scale=3):
62
  image_input = gr.Image(type="pil")
63
- prompt_textbox = gr.Textbox(label="Prompt:", placeholder="prompt", value="Please describe this image.", lines=2)
64
  output = gr.Textbox(label="Output")
65
  submit = gr.Button("Run", variant="primary")
66
 
@@ -77,25 +77,25 @@ with gr.Blocks(theme=theme, analytics_enabled=False,css=css) as demo:
77
  max_len = gr.Slider(
78
  minimum=10,
79
  maximum=500,
80
- value=250,
81
  step=5,
82
- interactive=True,
83
  label="Max Length",
84
  )
85
 
86
  sampling = gr.Radio(
87
  choices=["Beam search", "Nucleus sampling"],
88
- value="Nucleus sampling",
89
  label="Text Decoding Method",
90
- interactive=True,
91
  )
92
 
93
  top_p = gr.Slider(
94
  minimum=0.5,
95
  maximum=1.0,
96
- value=0.2,
97
  step=0.1,
98
- interactive=True,
99
  label="Top p",
100
  )
101
 
@@ -104,25 +104,25 @@ with gr.Blocks(theme=theme, analytics_enabled=False,css=css) as demo:
104
  maximum=10,
105
  value=5,
106
  step=1,
107
- interactive=True,
108
  label="Beam Size",
109
  )
110
 
111
  len_penalty = gr.Slider(
112
  minimum=-1,
113
  maximum=2,
114
- value=1,
115
  step=0.2,
116
- interactive=True,
117
  label="Length Penalty",
118
  )
119
 
120
  repetition_penalty = gr.Slider(
121
  minimum=-1,
122
  maximum=3,
123
- value=1,
124
  step=0.2,
125
- interactive=True,
126
  label="Repetition Penalty",
127
  )
128
  gr.Examples(
 
60
  with gr.Row():
61
  with gr.Column(scale=3):
62
  image_input = gr.Image(type="pil")
63
+ prompt_textbox = gr.Textbox(label="Prompt:", placeholder="prompt", value="Please describe what you see.", lines=2)
64
  output = gr.Textbox(label="Output")
65
  submit = gr.Button("Run", variant="primary")
66
 
 
77
  max_len = gr.Slider(
78
  minimum=10,
79
  maximum=500,
80
+ value=500,
81
  step=5,
82
+ interactive=False,
83
  label="Max Length",
84
  )
85
 
86
  sampling = gr.Radio(
87
  choices=["Beam search", "Nucleus sampling"],
88
+ value="Beam search",
89
  label="Text Decoding Method",
90
+ interactive=False,
91
  )
92
 
93
  top_p = gr.Slider(
94
  minimum=0.5,
95
  maximum=1.0,
96
+ value=0.9,
97
  step=0.1,
98
+ interactive=False,
99
  label="Top p",
100
  )
101
 
 
104
  maximum=10,
105
  value=5,
106
  step=1,
107
+ interactive=False,
108
  label="Beam Size",
109
  )
110
 
111
  len_penalty = gr.Slider(
112
  minimum=-1,
113
  maximum=2,
114
+ value=0.4,
115
  step=0.2,
116
+ interactive=False,
117
  label="Length Penalty",
118
  )
119
 
120
  repetition_penalty = gr.Slider(
121
  minimum=-1,
122
  maximum=3,
123
+ value=5,
124
  step=0.2,
125
+ interactive=False,
126
  label="Repetition Penalty",
127
  )
128
  gr.Examples(