pzangara commited on
Commit
cdb5960
1 Parent(s): 12632cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -11,14 +11,15 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
11
  def clasificador(input1, input2):
12
  classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
13
  sequence_to_classify = input1
14
- candidate_labels = input2
 
15
  output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
16
  return output
17
 
18
 
19
  iface = gr.Interface(
20
  fn=clasificador,
21
- inputs=[gr.inputs.Textbox(label="Ingrese texto"),gr.inputs.List(gr.inputs.Textbox(label="Ingrese lista de labels"))],
22
  outputs=gr.outputs.Textbox(label="Clasificación")
23
  )
24
 
 
11
  def clasificador(input1, input2):
12
  classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
13
  sequence_to_classify = input1
14
+ input2_list = input2.split(",") # Parse the input string as a list
15
+ candidate_labels= [item.strip() for item in input2_list]
16
  output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
17
  return output
18
 
19
 
20
  iface = gr.Interface(
21
  fn=clasificador,
22
+ inputs=[gr.inputs.Textbox(label="Ingrese texto"),gr.inputs.Textbox(label="Ingrese lista de labels")],
23
  outputs=gr.outputs.Textbox(label="Clasificación")
24
  )
25