Update app.py
Browse files
app.py
CHANGED
|
@@ -41,8 +41,8 @@ def process_input(text, rag, prompt_template):
|
|
| 41 |
output = generate(prompt)
|
| 42 |
|
| 43 |
# Generamos el archivo JSON
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
return output
|
| 48 |
|
|
@@ -56,12 +56,13 @@ def create_interface():
|
|
| 56 |
|
| 57 |
# Definimos la funci贸n que se ejecutar谩 cuando se env铆e la entrada
|
| 58 |
def fn(text, rag, prompt_template):
|
| 59 |
-
|
| 60 |
with open('output.json', 'r') as f:
|
| 61 |
data = json.load(f)
|
| 62 |
classification_types = [item['clasificacion_tipo'] for item in data]
|
| 63 |
classification_types_options = [(option, option) for option in classification_types]
|
| 64 |
classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
|
|
|
|
| 65 |
return output, classification_types_checkboxes
|
| 66 |
|
| 67 |
examples = [
|
|
|
|
| 41 |
output = generate(prompt)
|
| 42 |
|
| 43 |
# Generamos el archivo JSON
|
| 44 |
+
with open('output.json', 'w') as f:
|
| 45 |
+
json.dump(output, f)
|
| 46 |
|
| 47 |
return output
|
| 48 |
|
|
|
|
| 56 |
|
| 57 |
# Definimos la funci贸n que se ejecutar谩 cuando se env铆e la entrada
|
| 58 |
def fn(text, rag, prompt_template):
|
| 59 |
+
|
| 60 |
with open('output.json', 'r') as f:
|
| 61 |
data = json.load(f)
|
| 62 |
classification_types = [item['clasificacion_tipo'] for item in data]
|
| 63 |
classification_types_options = [(option, option) for option in classification_types]
|
| 64 |
classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
|
| 65 |
+
output = process_input(text, rag, prompt_template)
|
| 66 |
return output, classification_types_checkboxes
|
| 67 |
|
| 68 |
examples = [
|