Spaces:
Runtime error
Runtime error
Disabled customdata endpoint
Browse files
app.py
CHANGED
|
@@ -230,22 +230,21 @@ trainer = Trainer(hands,pose)
|
|
| 230 |
def home():
|
| 231 |
return f"<h1>Signify API</h1>"
|
| 232 |
|
| 233 |
-
@app.route('/customTrain', methods= ["POST"])
|
| 234 |
-
def custom_model():
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
# return jsonify({"status": "error", "message": f"Error training model: {str(e)}"}), 500
|
| 249 |
|
| 250 |
@app.route('/switchModel', methods=['POST', 'GET'])
|
| 251 |
def switch_model():
|
|
|
|
| 230 |
def home():
|
| 231 |
return f"<h1>Signify API</h1>"
|
| 232 |
|
| 233 |
+
# @app.route('/customTrain', methods= ["POST"])
|
| 234 |
+
# def custom_model():
|
| 235 |
+
# """
|
| 236 |
+
# Trigger custom training (POST)
|
| 237 |
+
# Always returns a valid Flask response to avoid None being returned.
|
| 238 |
+
# """
|
| 239 |
+
# try:
|
| 240 |
+
# status = trainer.run_training()
|
| 241 |
+
# if status:
|
| 242 |
+
# print("Model training completed")
|
| 243 |
+
# return jsonify({"status": "success", "message": "Custom model training completed and switched"}), 200
|
| 244 |
+
# else:
|
| 245 |
+
# return jsonify({"status": "failed", "message": "Custom training did not complete successfully"}), 500
|
| 246 |
+
# except Exception as e:
|
| 247 |
+
# return jsonify({"status": "error", "message": f"Error training model: {str(e)}"}), 500
|
|
|
|
| 248 |
|
| 249 |
@app.route('/switchModel', methods=['POST', 'GET'])
|
| 250 |
def switch_model():
|