ancerlop commited on
Commit
baa186f
1 Parent(s): 57505a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -132,8 +132,8 @@ def create_interface():
132
  def fn(text, rag, prompt_template):
133
 
134
  output = process_input(text, rag, prompt_template)
135
- data = json.loads(output)
136
- classification_types = [item['tipo'] for item in data]
137
  classification_types_options = [(option, option) for option in classification_types]
138
  classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
139
 
 
132
  def fn(text, rag, prompt_template):
133
 
134
  output = process_input(text, rag, prompt_template)
135
+ matches = re.findall(r'"tipo"\s*:\s*"(.*?)"', output)
136
+ classification_types = matches
137
  classification_types_options = [(option, option) for option in classification_types]
138
  classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
139