Spaces:
Sleeping
Sleeping
alperugurcan
commited on
Commit
•
bdd933c
1
Parent(s):
42afca8
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,9 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
-
# Load model
|
6 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
7 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
8 |
|
9 |
def predict(premise, hypothesis):
|
10 |
inputs = tokenizer(premise, hypothesis, return_tensors="pt", truncation=True)
|
|
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
+
# Load model - xlm-roberta-base'i doğrudan kullanalım
|
6 |
+
model = AutoModelForSequenceClassification.from_pretrained("xlm-roberta-base", num_labels=3)
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-base")
|
8 |
|
9 |
def predict(premise, hypothesis):
|
10 |
inputs = tokenizer(premise, hypothesis, return_tensors="pt", truncation=True)
|