Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -33,8 +33,11 @@ def home():
|
|
| 33 |
def predict():
|
| 34 |
try:
|
| 35 |
# Get code from request
|
| 36 |
-
data = request.get_json()
|
| 37 |
-
if "code" not in data:
|
|
|
|
|
|
|
|
|
|
| 38 |
return jsonify({"error": "Missing 'code' parameter"}), 400
|
| 39 |
|
| 40 |
code = data["code"]
|
|
|
|
| 33 |
def predict():
|
| 34 |
try:
|
| 35 |
# Get code from request
|
| 36 |
+
# data = request.get_json()
|
| 37 |
+
# if "code" not in data:
|
| 38 |
+
# return jsonify({"error": "Missing 'code' parameter"}), 400
|
| 39 |
+
data = request.get_json(force=True, silent=True)
|
| 40 |
+
if not data or "code" not in data:
|
| 41 |
return jsonify({"error": "Missing 'code' parameter"}), 400
|
| 42 |
|
| 43 |
code = data["code"]
|