KhairulAmirinUM commited on
Commit
19ab76e
·
1 Parent(s): a98612e
Files changed (1) hide show
  1. src/hf.py +3 -1
src/hf.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  from transformers import BertTokenizer, BertForSequenceClassification,TextClassificationPipeline, AutoModelForSequenceClassification
2
  # Load tokenizer and model from the fine-tuned directory
3
  model_path = './intent_classification/TinyBERT_106_V2' # can try other checkpoints
@@ -5,7 +7,7 @@ model_path = './intent_classification/TinyBERT_106_V2' # can try other checkpoi
5
  tokenizer = BertTokenizer.from_pretrained(model_path)
6
  # model = BertForSequenceClassification.from_pretrained(model_path)
7
  model = AutoModelForSequenceClassification.from_pretrained(model_path)
8
-
9
  print("TInyBERT model is ready to use")
10
 
11
 
 
1
+ import os.path
2
+
3
  from transformers import BertTokenizer, BertForSequenceClassification,TextClassificationPipeline, AutoModelForSequenceClassification
4
  # Load tokenizer and model from the fine-tuned directory
5
  model_path = './intent_classification/TinyBERT_106_V2' # can try other checkpoints
 
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
 
13