Spaces:
Sleeping
Sleeping
Update backend_model.py
Browse files109 unmodified lines110111112113114115116117118109 unmodified linesmodel = CodeBERTBinaryClassifier(base_model)# model = model.to(device)# Load the model# model = CodeBERTBinaryClassifier(base_model)model.load_state_dict(torch.load(model_path))model = model.to(device)return model, tokenizer109 unmodified lines110111112113114115116117109 unmodified linesmodel = CodeBERTBinaryClassifier(base_model)# model = model.to(device)map_location = torch.device('cuda' if torch.cuda.is_available() else 'cpu')model.load_state_dict(torch.load(model_path, map_location=map_location))model = model.to(map_location)return model, tokenizer
backend_model.py+3-4