Spaces:
Sleeping
Sleeping
Krish Patel
commited on
Commit
·
2f55336
1
Parent(s):
75f76a5
Trying to resolve the token issue
Browse files
final.py
CHANGED
|
@@ -13,7 +13,8 @@ nlp = spacy.load("en_core_web_sm")
|
|
| 13 |
|
| 14 |
# Load the trained ML model
|
| 15 |
model_path = "./results/checkpoint-753" # Replace with the actual path to your model
|
| 16 |
-
tokenizer = AutoTokenizer.from_pretrained('microsoft/deberta-v3-small')
|
|
|
|
| 17 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
| 18 |
model.eval()
|
| 19 |
|
|
|
|
| 13 |
|
| 14 |
# Load the trained ML model
|
| 15 |
model_path = "./results/checkpoint-753" # Replace with the actual path to your model
|
| 16 |
+
# tokenizer = AutoTokenizer.from_pretrained('microsoft/deberta-v3-small')
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained('microsoft/deberta-v3-small', use_fast=False)
|
| 18 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
| 19 |
model.eval()
|
| 20 |
|
st.py
CHANGED
|
@@ -3,9 +3,15 @@ import torch
|
|
| 3 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 4 |
|
| 5 |
# Load the model and tokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
@st.cache_resource
|
| 7 |
def load_model():
|
| 8 |
-
tokenizer = AutoTokenizer.from_pretrained('microsoft/deberta-v3-small')
|
| 9 |
model = AutoModelForSequenceClassification.from_pretrained("./results/checkpoint-753")
|
| 10 |
model.eval()
|
| 11 |
return tokenizer, model
|
|
|
|
| 3 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 4 |
|
| 5 |
# Load the model and tokenizer
|
| 6 |
+
# @st.cache_resource
|
| 7 |
+
# def load_model():
|
| 8 |
+
# tokenizer = AutoTokenizer.from_pretrained('microsoft/deberta-v3-small')
|
| 9 |
+
# model = AutoModelForSequenceClassification.from_pretrained("./results/checkpoint-753")
|
| 10 |
+
# model.eval()
|
| 11 |
+
# return tokenizer, model
|
| 12 |
@st.cache_resource
|
| 13 |
def load_model():
|
| 14 |
+
tokenizer = AutoTokenizer.from_pretrained('microsoft/deberta-v3-small', use_fast=False)
|
| 15 |
model = AutoModelForSequenceClassification.from_pretrained("./results/checkpoint-753")
|
| 16 |
model.eval()
|
| 17 |
return tokenizer, model
|