Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,6 +64,16 @@ except Exception as e:
|
|
| 64 |
sys.exit(1)
|
| 65 |
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
# 예측 API
|
| 68 |
@app.post("/predict")
|
| 69 |
async def predict_api(request: Request):
|
|
|
|
| 64 |
sys.exit(1)
|
| 65 |
|
| 66 |
|
| 67 |
+
@app.get("/")
|
| 68 |
+
def root(request: Request):
|
| 69 |
+
client_host = request.client.host
|
| 70 |
+
client_port = request.client.port
|
| 71 |
+
return {
|
| 72 |
+
"message": "Text Classification API is running!",
|
| 73 |
+
"client_ip": client_host,
|
| 74 |
+
"client_port": client_port
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
# 예측 API
|
| 78 |
@app.post("/predict")
|
| 79 |
async def predict_api(request: Request):
|