Pujan-Dev commited on
Commit
3f36270
·
verified ·
1 Parent(s): 07f9e5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -33,7 +33,7 @@ def load_model():
33
  model_path = "./Ai-Text-Detector/model"
34
  weights_path = "./Ai-Text-Detector/model_weights.pth"
35
  tokenizer = GPT2TokenizerFast.from_pretrained(model_path)
36
- model = GPT2LMHeadModel.from_pretrained("gpt2")
37
  model.load_state_dict(torch.load(weights_path, map_location=torch.device("cpu")))
38
  model.eval() # Set the model to evaluation mode
39
  return model, tokenizer
 
33
  model_path = "./Ai-Text-Detector/model"
34
  weights_path = "./Ai-Text-Detector/model_weights.pth"
35
  tokenizer = GPT2TokenizerFast.from_pretrained(model_path)
36
+ model = GPT2LMHeadModel.from_pretrained("gpt2",from_tf=True)
37
  model.load_state_dict(torch.load(weights_path, map_location=torch.device("cpu")))
38
  model.eval() # Set the model to evaluation mode
39
  return model, tokenizer