Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,10 +5,10 @@ from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassifica
|
|
| 5 |
import transformers
|
| 6 |
import gradio as gr
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def clasificador(input):
|
| 10 |
-
model_name = "MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7"
|
| 11 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 12 |
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
|
| 13 |
sequence_to_classify = input
|
| 14 |
candidate_labels = ["Nueva York","Barcelona","Buenos Aires","C贸rdoba","Roma","Londres","Sidney"]
|
|
@@ -18,6 +18,6 @@ def clasificador(input):
|
|
| 18 |
|
| 19 |
def application():
|
| 20 |
app = gr.Interface(fn=clasificador, inputs="text", outputs="text", title="Clasificador de geograf铆as urbanas")
|
| 21 |
-
return app.launch(
|
| 22 |
|
| 23 |
application()
|
|
|
|
| 5 |
import transformers
|
| 6 |
import gradio as gr
|
| 7 |
|
| 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 = ["Nueva York","Barcelona","Buenos Aires","C贸rdoba","Roma","Londres","Sidney"]
|
|
|
|
| 18 |
|
| 19 |
def application():
|
| 20 |
app = gr.Interface(fn=clasificador, inputs="text", outputs="text", title="Clasificador de geograf铆as urbanas")
|
| 21 |
+
return app.launch()
|
| 22 |
|
| 23 |
application()
|