Erfan11 commited on
Commit
2a58fc8
1 Parent(s): d1b183c

Update model_loading.py

Browse files
Files changed (1) hide show
  1. model_loading.py +7 -6
model_loading.py CHANGED
@@ -1,8 +1,9 @@
1
- from transformers import TFBertForSequenceClassification, BertTokenizerFast
 
 
2
 
3
- # Define the model name
4
- model_name = "Erfan11/Neuracraft"
5
 
6
- # Load the TensorFlow model and tokenizer
7
- model = TFBertForSequenceClassification.from_pretrained(model_name, use_auth_token="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")
8
- tokenizer = BertTokenizerFast.from_pretrained(model_name, use_auth_token="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")
 
1
+ import os
2
+ import tensorflow as tf
3
+ from dotenv import load_dotenv
4
 
5
+ load_dotenv()
6
+ model_path = os.getenv('MODEL_PATH')
7
 
8
+ def load_model():
9
+ return tf.keras.models.load_model(model_path)