Spaces:
Runtime error
Runtime error
Commit
·
bda04c4
1
Parent(s):
f40c56a
death to Netanperahu
Browse files
src/hf.py
CHANGED
@@ -4,9 +4,9 @@ from transformers import BertTokenizer, BertForSequenceClassification,TextClassi
|
|
4 |
# Load tokenizer and model from the fine-tuned directory
|
5 |
model_path = './intent_classification/TinyBERT_106_V2' # can try other checkpoints
|
6 |
|
7 |
-
tokenizer = BertTokenizer.from_pretrained(model_path)
|
8 |
# model = BertForSequenceClassification.from_pretrained(model_path)
|
9 |
-
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
10 |
print(os.path.exists(model_path))
|
11 |
print("TInyBERT model is ready to use")
|
12 |
|
|
|
4 |
# Load tokenizer and model from the fine-tuned directory
|
5 |
model_path = './intent_classification/TinyBERT_106_V2' # can try other checkpoints
|
6 |
|
7 |
+
tokenizer = BertTokenizer.from_pretrained(model_path, local_files_only=True)
|
8 |
# model = BertForSequenceClassification.from_pretrained(model_path)
|
9 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_path, local_files_only=True)
|
10 |
print(os.path.exists(model_path))
|
11 |
print("TInyBERT model is ready to use")
|
12 |
|