Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ model_name = "MoritzLaurer/mDeBERTa-v3-base-mnli-xnli"
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
9 |
|
10 |
-
def classify(text)
|
11 |
input = tokenizer(text, truncation=True, return_tensors="pt")
|
12 |
output = model(input["input_ids"].to(device)) # device = "cuda:0" or "cpu"
|
13 |
prediction = torch.softmax(output["logits"][0], -1).tolist()
|
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
9 |
|
10 |
+
def classify(text):
|
11 |
input = tokenizer(text, truncation=True, return_tensors="pt")
|
12 |
output = model(input["input_ids"].to(device)) # device = "cuda:0" or "cpu"
|
13 |
prediction = torch.softmax(output["logits"][0], -1).tolist()
|