Spaces:
Running
Running
Signed-off-by: peter szemraj <[email protected]>
app.py
CHANGED
@@ -20,10 +20,10 @@ def generate_text(
|
|
20 |
num_beams=4,
|
21 |
no_repeat_ngram_size=2,
|
22 |
length_penalty=1.0,
|
|
|
23 |
# perma params (not set by user)
|
24 |
repetition_penalty=3.5,
|
25 |
abs_max_length=512,
|
26 |
-
num_beam_groups=2,
|
27 |
verbose=False,
|
28 |
):
|
29 |
"""
|
@@ -215,19 +215,22 @@ if __name__ == "__main__":
|
|
215 |
"Load Model",
|
216 |
variant="secondary",
|
217 |
)
|
218 |
-
|
|
|
|
|
|
|
|
|
219 |
with gr.Row():
|
220 |
num_beams = gr.Radio(
|
221 |
choices=[4, 8, 12, 16],
|
222 |
label="Number of Beams",
|
223 |
value=4,
|
224 |
)
|
225 |
-
with gr.Row():
|
226 |
|
227 |
-
|
228 |
-
choices=[1, 2
|
229 |
-
label="
|
230 |
-
value=
|
231 |
)
|
232 |
length_penalty = gr.Slider(
|
233 |
minimum=0.5,
|
@@ -262,8 +265,9 @@ if __name__ == "__main__":
|
|
262 |
num_beams,
|
263 |
no_repeat_ngram_size,
|
264 |
length_penalty,
|
|
|
265 |
],
|
266 |
-
outputs=[
|
267 |
)
|
268 |
|
269 |
load_model_button.click(
|
|
|
20 |
num_beams=4,
|
21 |
no_repeat_ngram_size=2,
|
22 |
length_penalty=1.0,
|
23 |
+
num_beam_groups=2,
|
24 |
# perma params (not set by user)
|
25 |
repetition_penalty=3.5,
|
26 |
abs_max_length=512,
|
|
|
27 |
verbose=False,
|
28 |
):
|
29 |
"""
|
|
|
215 |
"Load Model",
|
216 |
variant="secondary",
|
217 |
)
|
218 |
+
no_repeat_ngram_size = gr.Radio(
|
219 |
+
choices=[1, 2, 3, 4],
|
220 |
+
label="no repeat ngram size",
|
221 |
+
value=2,
|
222 |
+
)
|
223 |
with gr.Row():
|
224 |
num_beams = gr.Radio(
|
225 |
choices=[4, 8, 12, 16],
|
226 |
label="Number of Beams",
|
227 |
value=4,
|
228 |
)
|
|
|
229 |
|
230 |
+
num_beam_groups = gr.Radio(
|
231 |
+
choices=[1, 2],
|
232 |
+
label="Number of Beam Groups",
|
233 |
+
value=1,
|
234 |
)
|
235 |
length_penalty = gr.Slider(
|
236 |
minimum=0.5,
|
|
|
265 |
num_beams,
|
266 |
no_repeat_ngram_size,
|
267 |
length_penalty,
|
268 |
+
num_beam_groups,
|
269 |
],
|
270 |
+
outputs=[email_template],
|
271 |
)
|
272 |
|
273 |
load_model_button.click(
|