Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -329,8 +329,7 @@ def check_chat_rate_limit(ip: str):
|
|
| 329 |
entry["count"] += 1
|
| 330 |
return entry["count"]
|
| 331 |
|
| 332 |
-
@app.head("/
|
| 333 |
-
@app.head("/gen/sfx")
|
| 334 |
async def head_sfx():
|
| 335 |
return Response(
|
| 336 |
status_code=200,
|
|
@@ -340,8 +339,7 @@ async def head_sfx():
|
|
| 340 |
}
|
| 341 |
)
|
| 342 |
|
| 343 |
-
@app.head("/
|
| 344 |
-
@app.head("/genimg/{prompt}")
|
| 345 |
async def head_image():
|
| 346 |
return Response(
|
| 347 |
status_code=200,
|
|
@@ -351,13 +349,12 @@ async def head_image():
|
|
| 351 |
}
|
| 352 |
)
|
| 353 |
|
| 354 |
-
@app.head("/
|
| 355 |
-
|
| 356 |
-
async def head_image():
|
| 357 |
return Response(
|
| 358 |
-
status_code=
|
| 359 |
headers={
|
| 360 |
-
"Content-Type": "
|
| 361 |
"Accept-Ranges": "bytes",
|
| 362 |
}
|
| 363 |
)
|
|
@@ -392,7 +389,7 @@ async def generate_image(request: Request, prompt: str = None):
|
|
| 392 |
content=response.content,
|
| 393 |
media_type="image/jpeg"
|
| 394 |
)
|
| 395 |
-
|
| 396 |
@app.get("/models")
|
| 397 |
async def get_models() -> List[Dict]:
|
| 398 |
async with httpx.AsyncClient() as client:
|
|
|
|
| 329 |
entry["count"] += 1
|
| 330 |
return entry["count"]
|
| 331 |
|
| 332 |
+
@app.head("/status/sfx")
|
|
|
|
| 333 |
async def head_sfx():
|
| 334 |
return Response(
|
| 335 |
status_code=200,
|
|
|
|
| 339 |
}
|
| 340 |
)
|
| 341 |
|
| 342 |
+
@app.head("/status/image")
|
|
|
|
| 343 |
async def head_image():
|
| 344 |
return Response(
|
| 345 |
status_code=200,
|
|
|
|
| 349 |
}
|
| 350 |
)
|
| 351 |
|
| 352 |
+
@app.head("/status/video")
|
| 353 |
+
async def head_video():
|
|
|
|
| 354 |
return Response(
|
| 355 |
+
status_code=500,
|
| 356 |
headers={
|
| 357 |
+
"Content-Type": "video/mp4",
|
| 358 |
"Accept-Ranges": "bytes",
|
| 359 |
}
|
| 360 |
)
|
|
|
|
| 389 |
content=response.content,
|
| 390 |
media_type="image/jpeg"
|
| 391 |
)
|
| 392 |
+
@app.head("/models")
|
| 393 |
@app.get("/models")
|
| 394 |
async def get_models() -> List[Dict]:
|
| 395 |
async with httpx.AsyncClient() as client:
|