Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -234,8 +234,7 @@ def generate_space_name():
|
|
234 |
"""Generate a unique Space name."""
|
235 |
random_suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
236 |
return f"GeneratedSpace-{random_suffix}"
|
237 |
-
@app
|
238 |
-
.route('/create-space', methods=['POST'])
|
239 |
def create_hf_space():
|
240 |
try:
|
241 |
# Parse JSON input
|
@@ -336,8 +335,7 @@ except json.JSONDecodeError:
|
|
336 |
return jsonify({"error": "Invalid JSON format"}), 400
|
337 |
except Exception as e:
|
338 |
return jsonify({"error": str(e)}), 500
|
339 |
-
@app
|
340 |
-
.route('/docs', methods=['GET'])
|
341 |
def get_docs():
|
342 |
"""Return the API documentation as plain text."""
|
343 |
return Response(DOCUMENTATION, mimetype='text/plain'), 200
|
|
|
234 |
"""Generate a unique Space name."""
|
235 |
random_suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
236 |
return f"GeneratedSpace-{random_suffix}"
|
237 |
+
@app.route('/create-space', methods=['POST'])
|
|
|
238 |
def create_hf_space():
|
239 |
try:
|
240 |
# Parse JSON input
|
|
|
335 |
return jsonify({"error": "Invalid JSON format"}), 400
|
336 |
except Exception as e:
|
337 |
return jsonify({"error": str(e)}), 500
|
338 |
+
@app.route('/docs', methods=['GET'])
|
|
|
339 |
def get_docs():
|
340 |
"""Return the API documentation as plain text."""
|
341 |
return Response(DOCUMENTATION, mimetype='text/plain'), 200
|