ancerlop commited on
Commit
98be4ed
1 Parent(s): 18882b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import json
 
3
  from huggingface_hub import InferenceClient
4
 
5
  client = InferenceClient(
@@ -131,7 +132,8 @@ def create_interface():
131
  def fn(text, rag, prompt_template):
132
 
133
  output = process_input(text, rag, prompt_template)
134
- classification_types = [item['clasificacion_tipo'] for item in output]
 
135
  classification_types_options = [(option, option) for option in classification_types]
136
  classification_types_checkboxes = gr.CheckboxGroup(label="Clasificacion Tipo", choices=classification_types_options, interactive = True)
137
 
 
1
  import gradio as gr
2
  import json
3
+ import re
4
  from huggingface_hub import InferenceClient
5
 
6
  client = InferenceClient(
 
132
  def fn(text, rag, prompt_template):
133
 
134
  output = process_input(text, rag, prompt_template)
135
+ matches = re.findall(r"'tipo': '([^']+)'", 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