Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from flask import Flask, request, jsonify
|
| 2 |
from gradio_client import Client, handle_file
|
| 3 |
import tempfile, base64, os, threading
|
|
|
|
| 4 |
|
| 5 |
from flask_cors import CORS # ✅ allow mobile apps to call this API
|
| 6 |
|
|
@@ -126,7 +127,7 @@ def predict_periodontitis():
|
|
| 126 |
return jsonify({"error": str(e)}), 500
|
| 127 |
|
| 128 |
|
| 129 |
-
#
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
app.run(
|
|
|
|
| 1 |
from flask import Flask, request, jsonify
|
| 2 |
from gradio_client import Client, handle_file
|
| 3 |
import tempfile, base64, os, threading
|
| 4 |
+
from huggingface_hub import InferenceClient
|
| 5 |
|
| 6 |
from flask_cors import CORS # ✅ allow mobile apps to call this API
|
| 7 |
|
|
|
|
| 127 |
return jsonify({"error": str(e)}), 500
|
| 128 |
|
| 129 |
|
| 130 |
+
# 🚀 Required function for Hugging Face Spaces
|
| 131 |
+
def start():
|
| 132 |
+
# HF Spaces automatically assigns host/port
|
| 133 |
+
app.run()
|