Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,22 +61,33 @@ if __name__ == "__main__":
|
|
61 |
gen = gr.Button("Generate")
|
62 |
clr = gr.Button("Clear")
|
63 |
|
|
|
|
|
|
|
|
|
|
|
64 |
seed = gr.Slider(maximum=100000, value=1234, step=1, label='Seed')
|
65 |
out_seq_length = gr.Slider(maximum=256, value=128, minimum=32, step=1, label='Output Sequence Length')
|
66 |
with gr.Column():
|
67 |
-
outputs = gr.Textbox(lines=7, label='Output')
|
68 |
min_gen_length = gr.Slider(maximum=64, value=0, step=1, label='Min Generate Length')
|
69 |
-
|
70 |
-
sampling_strategy = gr.Radio(choices=['BeamSearchStrategy', 'BaseStrategy'], value='BeamSearchStrategy', label='Search Strategy')
|
71 |
|
72 |
-
with gr.
|
73 |
-
with gr.
|
74 |
# beam search
|
|
|
|
|
|
|
|
|
75 |
num_beams = gr.Slider(maximum=4, value=1, minimum=1, step=1, label='Number of Beams')
|
76 |
length_penalty = gr.Slider(maximum=1, value=0.8, minimum=0, label='Length Penalty')
|
77 |
no_repeat_ngram_size = gr.Slider(maximum=5, value=3, minimum=1, step=1, label='No Repeat Ngram Size')
|
78 |
-
with gr.
|
79 |
# base search
|
|
|
|
|
|
|
|
|
80 |
temperature = gr.Slider(maximum=1, value=1, minimum=0, label='Temperature')
|
81 |
topk = gr.Slider(maximum=8, value=1, minimum=0, step=1, label='Top K')
|
82 |
topp = gr.Slider(maximum=1, value=0, minimum=0, label='Top P')
|
|
|
61 |
gen = gr.Button("Generate")
|
62 |
clr = gr.Button("Clear")
|
63 |
|
64 |
+
outputs = gr.Textbox(lines=7, label='Output')
|
65 |
+
|
66 |
+
|
67 |
+
with gr.Row():
|
68 |
+
with gr.Column():
|
69 |
seed = gr.Slider(maximum=100000, value=1234, step=1, label='Seed')
|
70 |
out_seq_length = gr.Slider(maximum=256, value=128, minimum=32, step=1, label='Output Sequence Length')
|
71 |
with gr.Column():
|
|
|
72 |
min_gen_length = gr.Slider(maximum=64, value=0, step=1, label='Min Generate Length')
|
73 |
+
sampling_strategy = gr.Radio(choices=['BeamSearchStrategy', 'BaseStrategy'], value='BeamSearchStrategy', label='Search Strategy')
|
|
|
74 |
|
75 |
+
with gr.Row():
|
76 |
+
with gr.Column():
|
77 |
# beam search
|
78 |
+
gr.Markdown(
|
79 |
+
"""
|
80 |
+
Beam Search Parameter
|
81 |
+
""")
|
82 |
num_beams = gr.Slider(maximum=4, value=1, minimum=1, step=1, label='Number of Beams')
|
83 |
length_penalty = gr.Slider(maximum=1, value=0.8, minimum=0, label='Length Penalty')
|
84 |
no_repeat_ngram_size = gr.Slider(maximum=5, value=3, minimum=1, step=1, label='No Repeat Ngram Size')
|
85 |
+
with gr.Column():
|
86 |
# base search
|
87 |
+
gr.Markdown(
|
88 |
+
"""
|
89 |
+
Base Search Parameter
|
90 |
+
""")
|
91 |
temperature = gr.Slider(maximum=1, value=1, minimum=0, label='Temperature')
|
92 |
topk = gr.Slider(maximum=8, value=1, minimum=0, step=1, label='Top K')
|
93 |
topp = gr.Slider(maximum=1, value=0, minimum=0, label='Top P')
|