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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,17 +8,17 @@ import gradio as gr
8
  model_name = "MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7"
9
  tokenizer = AutoTokenizer.from_pretrained(model_name)
10
 
11
- def clasificador(input):
12
  classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
13
- sequence_to_classify = input
14
- candidate_labels = ["consumidor","ventas","ganancias","cliente","prestamo","dinero"]
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"),
22
  outputs=gr.outputs.Textbox(label="Clasificación")
23
  )
24
 
 
8
  model_name = "MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7"
9
  tokenizer = AutoTokenizer.from_pretrained(model_name)
10
 
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