Erfan11 commited on
Commit
caa9290
1 Parent(s): 83ed8ca

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -6
main.py CHANGED
@@ -7,13 +7,13 @@ import tensorflow as tf
7
  MODEL_NAME = "Erfan11/Neuracraft"
8
  API_KEY = "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"
9
 
10
- def load_model(model_name):
11
  # Load the TensorFlow model from Hugging Face Hub
12
- model = TFBertForSequenceClassification.from_pretrained(model_name, use_auth_token=API_KEY)
13
  return model
14
 
15
- def load_tokenizer(model_name):
16
- tokenizer = BertTokenizerFast.from_pretrained(model_name, use_auth_token=API_KEY)
17
  return tokenizer
18
 
19
  def predict(text, model, tokenizer):
@@ -22,8 +22,8 @@ def predict(text, model, tokenizer):
22
  return outputs
23
 
24
  def main():
25
- model_name = MODEL_NAME
26
- model = load_model(model_name)
27
  tokenizer = load_tokenizer(model_name)
28
  # Example usage
29
  text = "Sample input text"
 
7
  MODEL_NAME = "Erfan11/Neuracraft"
8
  API_KEY = "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"
9
 
10
+ def load_model(Erfan11/Neuracraft):
11
  # Load the TensorFlow model from Hugging Face Hub
12
+ model = TFBertForSequenceClassification.from_pretrained(model_name, use_auth_token=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)
13
  return model
14
 
15
+ def load_tokenizer(Erfan11/Neuracraft):
16
+ tokenizer = BertTokenizerFast.from_pretrained(model_name, use_auth_token=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)
17
  return tokenizer
18
 
19
  def predict(text, model, tokenizer):
 
22
  return outputs
23
 
24
  def main():
25
+ model_name = Erfan11/Neuracraft
26
+ model = load_model(Erfan11/Neuracraft)
27
  tokenizer = load_tokenizer(model_name)
28
  # Example usage
29
  text = "Sample input text"