Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -10,7 +10,7 @@ app = Flask(name)
|
|
10 |
tokenizer = RobertaTokenizer.from_pretrained("microsoft/codebert-base")
|
11 |
model = torch.load("model.pth", map_location=torch.device('cpu')) # Load the trained model
|
12 |
|
13 |
-
Ensure the model is in evaluation mode
|
14 |
model.eval()
|
15 |
|
16 |
|
@@ -53,6 +53,6 @@ def predict():
|
|
53 |
return jsonify({"error": str(e)}), 500
|
54 |
|
55 |
|
56 |
-
Run the Flask app
|
57 |
if name == "main":
|
58 |
app.run(debug=True)
|
|
|
10 |
tokenizer = RobertaTokenizer.from_pretrained("microsoft/codebert-base")
|
11 |
model = torch.load("model.pth", map_location=torch.device('cpu')) # Load the trained model
|
12 |
|
13 |
+
# Ensure the model is in evaluation mode
|
14 |
model.eval()
|
15 |
|
16 |
|
|
|
53 |
return jsonify({"error": str(e)}), 500
|
54 |
|
55 |
|
56 |
+
# Run the Flask app
|
57 |
if name == "main":
|
58 |
app.run(debug=True)
|