Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -251,7 +251,7 @@ async def generate_image(
|
|
251 |
params['enhance'] = str(enhance).lower()
|
252 |
|
253 |
try:
|
254 |
-
timeout = httpx.Timeout(
|
255 |
async with httpx.AsyncClient(timeout=timeout) as client:
|
256 |
response = await client.get(url, params=params, follow_redirects=True)
|
257 |
|
@@ -309,7 +309,8 @@ async def startup_event():
|
|
309 |
print("GET /models")
|
310 |
print("GET /searchgpt") # We now have the new search API
|
311 |
print("POST /chat/completions")
|
312 |
-
|
|
|
313 |
if __name__ == "__main__":
|
314 |
import uvicorn
|
315 |
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
251 |
params['enhance'] = str(enhance).lower()
|
252 |
|
253 |
try:
|
254 |
+
timeout = httpx.Timeout(60.0) # Set a reasonable timeout
|
255 |
async with httpx.AsyncClient(timeout=timeout) as client:
|
256 |
response = await client.get(url, params=params, follow_redirects=True)
|
257 |
|
|
|
309 |
print("GET /models")
|
310 |
print("GET /searchgpt") # We now have the new search API
|
311 |
print("POST /chat/completions")
|
312 |
+
print("GET /images/generations")
|
313 |
+
|
314 |
if __name__ == "__main__":
|
315 |
import uvicorn
|
316 |
uvicorn.run(app, host="0.0.0.0", port=8000)
|