Update app.py
Browse files32 unmodified lines3334353637383932 unmodified linesmodel_path = "./Ai-Text-Detector/model"weights_path = "./Ai-Text-Detector/model_weights.pth"tokenizer = GPT2TokenizerFast.from_pretrained(model_path)model = GPT2LMHeadModel.from_pretrained("gpt2")model.load_state_dict(torch.load(weights_path, map_location=torch.device("cpu")))model.eval() # Set the model to evaluation modereturn model, tokenizer32 unmodified lines3334353637383932 unmodified linesmodel_path = "./Ai-Text-Detector/model"weights_path = "./Ai-Text-Detector/model_weights.pth"tokenizer = GPT2TokenizerFast.from_pretrained(model_path)model = GPT2LMHeadModel.from_pretrained("gpt2",from_tf=True)model.load_state_dict(torch.load(weights_path, map_location=torch.device("cpu")))model.eval() # Set the model to evaluation modereturn model, tokenizer
app.py+1-1