ancerlop commited on
Commit
c6912ee
1 Parent(s): 94599e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- #with open('output.json', 'w') as f:
45
- # json.dump(output, f)
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
- output = process_input(text, rag, prompt_template)
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 = [