Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,11 +16,6 @@ REPO_ID = os.getenv("HF_REPO_ID")
|
|
| 16 |
# Initialize Hugging Face API
|
| 17 |
login(token=HF_TOKEN)
|
| 18 |
api = HfApi()
|
| 19 |
-
|
| 20 |
-
print("curl -X POST https://<your-space-name>.hf.space/upload \
|
| 21 |
-
-F "image=@/path/to/image.jpg" \
|
| 22 |
-
-F "guid=test-guid" \
|
| 23 |
-
-F "ip=127.0.0.1"")
|
| 24 |
|
| 25 |
@app.route('/upload', methods=['POST'])
|
| 26 |
def upload_image():
|
|
@@ -75,6 +70,9 @@ def upload_image():
|
|
| 75 |
return jsonify({"error": str(e)}), 500
|
| 76 |
|
| 77 |
if __name__ == '__main__':
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
| 79 |
port = int(os.environ.get("PORT", 7860))
|
| 80 |
app.run(host="0.0.0.0", port=port)
|
|
|
|
| 16 |
# Initialize Hugging Face API
|
| 17 |
login(token=HF_TOKEN)
|
| 18 |
api = HfApi()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
@app.route('/upload', methods=['POST'])
|
| 21 |
def upload_image():
|
|
|
|
| 70 |
return jsonify({"error": str(e)}), 500
|
| 71 |
|
| 72 |
if __name__ == '__main__':
|
| 73 |
+
print('''curl -X POST https://<your-space-name>.hf.space/upload \\
|
| 74 |
+
-F "image=@/path/to/image.jpg" \\
|
| 75 |
+
-F "guid=test-guid" \\
|
| 76 |
+
-F "ip=127.0.0.1"''')
|
| 77 |
port = int(os.environ.get("PORT", 7860))
|
| 78 |
app.run(host="0.0.0.0", port=port)
|