Spaces:
Running
Running
Fix bug interface
Browse files
app.py
CHANGED
@@ -138,46 +138,46 @@ def gradio_app():
|
|
138 |
gr.Markdown(markdown_description[language])
|
139 |
with gr.Row(equal_height=True):
|
140 |
model_select = gr.Dropdown(
|
141 |
-
label=get_text_lang
|
142 |
choices=MODEL_NAMES,
|
143 |
value=MODEL_NAMES[0],
|
144 |
interactive=True
|
145 |
)
|
146 |
with gr.Row(equal_height=True):
|
147 |
with gr.Column():
|
148 |
-
text_gl = gr.Textbox(label=get_text_lang
|
149 |
lines=6, placeholder="e.g. O neno vai a escola con ")
|
150 |
with gr.Row(variant="panel"):
|
151 |
-
with gr.Accordion(get_text_lang
|
152 |
max_length = Slider(
|
153 |
minimum=1,
|
154 |
maximum=200,
|
155 |
step=1,
|
156 |
value=30,
|
157 |
-
label=get_text_lang
|
158 |
)
|
159 |
repetition_penalty = Slider(
|
160 |
minimum=0.1,
|
161 |
maximum=4,
|
162 |
step=0.1,
|
163 |
value=1.3,
|
164 |
-
label=get_text_lang
|
165 |
)
|
166 |
temperature = Slider(
|
167 |
minimum=0,
|
168 |
maximum=1,
|
169 |
value=0.5,
|
170 |
-
label=get_text_lang
|
171 |
)
|
172 |
-
generator_btn = gr.Button(value=get_text_lang
|
173 |
with gr.Column():
|
174 |
-
generated_gl = gr.Textbox(label=get_text_lang
|
175 |
lines=6,
|
176 |
-
placeholder=get_text_lang
|
177 |
interactive=False,
|
178 |
show_copy_button=True)
|
179 |
-
pass_btn = gr.Button(value=get_text_lang
|
180 |
-
clean_btn = gr.Button(value=get_text_lang
|
181 |
|
182 |
generator_btn.click(predict, inputs=[text_gl, model_select, max_length, repetition_penalty, temperature], outputs=generated_gl, api_name="generate-flor-gl")
|
183 |
clean_btn.click(fn=clear, inputs=[], outputs=[text_gl, generated_gl, max_length, repetition_penalty, temperature], queue=False, api_name=False)
|
@@ -186,7 +186,7 @@ def gradio_app():
|
|
186 |
with gr.Row():
|
187 |
with gr.Column(scale=0.5):
|
188 |
gr.Examples(
|
189 |
-
label = get_text_lang
|
190 |
examples = short_prompts_examples,
|
191 |
inputs = [text_gl],
|
192 |
outputs = [max_length, repetition_penalty, temperature],
|
@@ -194,7 +194,7 @@ def gradio_app():
|
|
194 |
run_on_click = True
|
195 |
)
|
196 |
gr.Examples(
|
197 |
-
label = get_text_lang
|
198 |
examples = few_shot_prompts_examples,
|
199 |
inputs = [text_gl],
|
200 |
outputs = [max_length, repetition_penalty, temperature],
|
|
|
138 |
gr.Markdown(markdown_description[language])
|
139 |
with gr.Row(equal_height=True):
|
140 |
model_select = gr.Dropdown(
|
141 |
+
label=get_text_lang("model_select"),
|
142 |
choices=MODEL_NAMES,
|
143 |
value=MODEL_NAMES[0],
|
144 |
interactive=True
|
145 |
)
|
146 |
with gr.Row(equal_height=True):
|
147 |
with gr.Column():
|
148 |
+
text_gl = gr.Textbox(label=get_text_lang("text_gl"),
|
149 |
lines=6, placeholder="e.g. O neno vai a escola con ")
|
150 |
with gr.Row(variant="panel"):
|
151 |
+
with gr.Accordion(get_text_lang("accordion_parameters"), open=False):
|
152 |
max_length = Slider(
|
153 |
minimum=1,
|
154 |
maximum=200,
|
155 |
step=1,
|
156 |
value=30,
|
157 |
+
label=get_text_lang("max_length")
|
158 |
)
|
159 |
repetition_penalty = Slider(
|
160 |
minimum=0.1,
|
161 |
maximum=4,
|
162 |
step=0.1,
|
163 |
value=1.3,
|
164 |
+
label=get_text_lang("repetition_penalty")
|
165 |
)
|
166 |
temperature = Slider(
|
167 |
minimum=0,
|
168 |
maximum=1,
|
169 |
value=0.5,
|
170 |
+
label=get_text_lang("temperature")
|
171 |
)
|
172 |
+
generator_btn = gr.Button(value=get_text_lang("generator_btn"),variant='primary')
|
173 |
with gr.Column():
|
174 |
+
generated_gl = gr.Textbox(label=get_text_lang("generated_gl_label"),
|
175 |
lines=6,
|
176 |
+
placeholder=get_text_lang("generated_gl_placeholder"),
|
177 |
interactive=False,
|
178 |
show_copy_button=True)
|
179 |
+
pass_btn = gr.Button(value=get_text_lang("pass_btn"))
|
180 |
+
clean_btn = gr.Button(value=get_text_lang("clean_btn"))
|
181 |
|
182 |
generator_btn.click(predict, inputs=[text_gl, model_select, max_length, repetition_penalty, temperature], outputs=generated_gl, api_name="generate-flor-gl")
|
183 |
clean_btn.click(fn=clear, inputs=[], outputs=[text_gl, generated_gl, max_length, repetition_penalty, temperature], queue=False, api_name=False)
|
|
|
186 |
with gr.Row():
|
187 |
with gr.Column(scale=0.5):
|
188 |
gr.Examples(
|
189 |
+
label = get_text_lang("examples_short_prompts"),
|
190 |
examples = short_prompts_examples,
|
191 |
inputs = [text_gl],
|
192 |
outputs = [max_length, repetition_penalty, temperature],
|
|
|
194 |
run_on_click = True
|
195 |
)
|
196 |
gr.Examples(
|
197 |
+
label = get_text_lang("examples_few_shot"),
|
198 |
examples = few_shot_prompts_examples,
|
199 |
inputs = [text_gl],
|
200 |
outputs = [max_length, repetition_penalty, temperature],
|