Spaces:
Runtime error
Runtime error
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.
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
|
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=
|
81 |
step=5,
|
82 |
-
interactive=
|
83 |
label="Max Length",
|
84 |
)
|
85 |
|
86 |
sampling = gr.Radio(
|
87 |
choices=["Beam search", "Nucleus sampling"],
|
88 |
-
value="
|
89 |
label="Text Decoding Method",
|
90 |
-
interactive=
|
91 |
)
|
92 |
|
93 |
top_p = gr.Slider(
|
94 |
minimum=0.5,
|
95 |
maximum=1.0,
|
96 |
-
value=0.
|
97 |
step=0.1,
|
98 |
-
interactive=
|
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=
|
108 |
label="Beam Size",
|
109 |
)
|
110 |
|
111 |
len_penalty = gr.Slider(
|
112 |
minimum=-1,
|
113 |
maximum=2,
|
114 |
-
value=
|
115 |
step=0.2,
|
116 |
-
interactive=
|
117 |
label="Length Penalty",
|
118 |
)
|
119 |
|
120 |
repetition_penalty = gr.Slider(
|
121 |
minimum=-1,
|
122 |
maximum=3,
|
123 |
-
value=
|
124 |
step=0.2,
|
125 |
-
interactive=
|
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(
|