Update app.py
Browse files
app.py
CHANGED
@@ -167,13 +167,33 @@ with gr.Blocks() as demo:
|
|
167 |
|
168 |
def update_visible_elements(action):
|
169 |
if action == "Traducir":
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
171 |
elif action == "Resumen":
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
173 |
elif action == "Clasificar":
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
175 |
else:
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
177 |
|
178 |
action.change(update_visible_elements, inputs=action, outputs=[target_language, summary_length, question, question_button, output_text, answer])
|
179 |
|
@@ -196,4 +216,4 @@ with gr.Blocks() as demo:
|
|
196 |
question_button.click(answer_question, inputs=[output_text, question], outputs=answer)
|
197 |
|
198 |
# Ejecutar la aplicaci贸n Gradio
|
199 |
-
demo.launch(share=True)
|
|
|
167 |
|
168 |
def update_visible_elements(action):
|
169 |
if action == "Traducir":
|
170 |
+
target_language.update(visible=True)
|
171 |
+
summary_length.update(visible=False)
|
172 |
+
question.update(visible=False)
|
173 |
+
question_button.update(visible=False)
|
174 |
+
output_text.update(visible=True)
|
175 |
+
answer.update(visible=False)
|
176 |
elif action == "Resumen":
|
177 |
+
target_language.update(visible=False)
|
178 |
+
summary_length.update(visible=True)
|
179 |
+
question.update(visible(False))
|
180 |
+
question_button.update(visible(False))
|
181 |
+
output_text.update(visible=True)
|
182 |
+
answer.update(visible(False))
|
183 |
elif action == "Clasificar":
|
184 |
+
target_language.update(visible(False))
|
185 |
+
summary_length.update(visible(False))
|
186 |
+
question.update(visible=True)
|
187 |
+
question_button.update(visible=True)
|
188 |
+
output_text.update(visible=True)
|
189 |
+
answer.update(visible(True))
|
190 |
else:
|
191 |
+
target_language.update(visible(False))
|
192 |
+
summary_length.update(visible(False))
|
193 |
+
question.update(visible(False))
|
194 |
+
question_button.update(visible(False))
|
195 |
+
output_text.update(visible(False))
|
196 |
+
answer.update(visible(False))
|
197 |
|
198 |
action.change(update_visible_elements, inputs=action, outputs=[target_language, summary_length, question, question_button, output_text, answer])
|
199 |
|
|
|
216 |
question_button.click(answer_question, inputs=[output_text, question], outputs=answer)
|
217 |
|
218 |
# Ejecutar la aplicaci贸n Gradio
|
219 |
+
demo.launch(share=True)
|