Update app.py
Browse files
app.py
CHANGED
|
@@ -102,10 +102,6 @@ def process_input(text, rag, prompt_template):
|
|
| 102 |
|
| 103 |
"""
|
| 104 |
output = generate(prompt)
|
| 105 |
-
|
| 106 |
-
# Generamos el archivo JSON
|
| 107 |
-
with open('output2.json', 'w') as f:
|
| 108 |
-
json.dump(output, f)
|
| 109 |
|
| 110 |
return output
|
| 111 |
|
|
@@ -124,7 +120,7 @@ def create_interface():
|
|
| 124 |
matches = re.findall(r'"tipo"\s*:\s*"(.*?)"', output)
|
| 125 |
classification_types = matches
|
| 126 |
classification_types_options = [(option, option) for option in classification_types]
|
| 127 |
-
classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
|
| 128 |
mark_checkboxes(output, classification_types_options)
|
| 129 |
save_output(output, classification_types_options)
|
| 130 |
return output, classification_types_checkboxes
|
|
@@ -150,7 +146,9 @@ def create_interface():
|
|
| 150 |
fn=fn,
|
| 151 |
inputs=[input_text, rag_checkbox, prompt_template],
|
| 152 |
outputs=[output_text, classification_types_checkboxes],
|
| 153 |
-
examples=examples
|
|
|
|
|
|
|
| 154 |
)
|
| 155 |
|
| 156 |
return iface
|
|
|
|
| 102 |
|
| 103 |
"""
|
| 104 |
output = generate(prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
return output
|
| 107 |
|
|
|
|
| 120 |
matches = re.findall(r'"tipo"\s*:\s*"(.*?)"', output)
|
| 121 |
classification_types = matches
|
| 122 |
classification_types_options = [(option, option) for option in classification_types]
|
| 123 |
+
classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options,value=[option[0] for option in classification_types_options], interactive = True)
|
| 124 |
mark_checkboxes(output, classification_types_options)
|
| 125 |
save_output(output, classification_types_options)
|
| 126 |
return output, classification_types_checkboxes
|
|
|
|
| 146 |
fn=fn,
|
| 147 |
inputs=[input_text, rag_checkbox, prompt_template],
|
| 148 |
outputs=[output_text, classification_types_checkboxes],
|
| 149 |
+
examples=examples,
|
| 150 |
+
allow_flagging="manual",
|
| 151 |
+
flagging_options=["👍", "👎"]
|
| 152 |
)
|
| 153 |
|
| 154 |
return iface
|