Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ def process_input(text, rag, prompt_template):
|
|
| 42 |
prompt += rag_text
|
| 43 |
if prompt_template:
|
| 44 |
prompt += prompt_template_text
|
| 45 |
-
|
| 46 |
|
| 47 |
# Convertimos el generador en una cadena JSON
|
| 48 |
#json_str = ''.join(json_text)
|
|
@@ -73,12 +73,19 @@ def create_interface():
|
|
| 73 |
classification_types_options = [(option, option) for option in classification_types]
|
| 74 |
classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
|
| 75 |
return output, classification_types_checkboxes
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
# Creamos la interfaz
|
| 78 |
iface = gr.Interface(
|
| 79 |
fn=fn,
|
| 80 |
inputs=[input_text, rag_checkbox, prompt_template],
|
| 81 |
-
outputs=[output_text, classification_types_checkboxes]
|
|
|
|
| 82 |
)
|
| 83 |
|
| 84 |
return iface
|
|
|
|
| 42 |
prompt += rag_text
|
| 43 |
if prompt_template:
|
| 44 |
prompt += prompt_template_text
|
| 45 |
+
text = generate(prompt)
|
| 46 |
|
| 47 |
# Convertimos el generador en una cadena JSON
|
| 48 |
#json_str = ''.join(json_text)
|
|
|
|
| 73 |
classification_types_options = [(option, option) for option in classification_types]
|
| 74 |
classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
|
| 75 |
return output, classification_types_checkboxes
|
| 76 |
+
|
| 77 |
+
examples = [
|
| 78 |
+
["La carga de la prueba corresponde al 贸rgano instructor del procedimiento."],
|
| 79 |
+
["La sanci贸n es excesiva."],
|
| 80 |
+
["El delito ha prescrito."],
|
| 81 |
+
]
|
| 82 |
+
|
| 83 |
# Creamos la interfaz
|
| 84 |
iface = gr.Interface(
|
| 85 |
fn=fn,
|
| 86 |
inputs=[input_text, rag_checkbox, prompt_template],
|
| 87 |
+
outputs=[output_text, classification_types_checkboxes],
|
| 88 |
+
examples=examples
|
| 89 |
)
|
| 90 |
|
| 91 |
return iface
|