Erfan11 commited on
Commit
8366538
1 Parent(s): f431ad3

Update model_loading.py

Browse files
Files changed (1) hide show
  1. model_loading.py +6 -7
model_loading.py CHANGED
@@ -1,9 +1,8 @@
1
- # Use a pipeline as a high-level helper
2
- from transformers import pipeline
3
 
4
- pipe = pipeline("text-generation", model="openai-community/gpt2")
5
- # Load model directly
6
- from transformers import AutoTokenizer, AutoModelForCausalLM
7
 
8
- tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
9
- model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")
 
 
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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")