Skip to content

Commit

Permalink
Increase the initial character read timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Jul 18, 2024
1 parent aa42078 commit 4bd89b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@asynccontextmanager
async def lifespan(app: FastAPI):
# 启动时的代码
timeout = httpx.Timeout(connect=15.0, read=5.0, write=30.0, pool=30.0)
timeout = httpx.Timeout(connect=15.0, read=10.0, write=30.0, pool=30.0)
app.state.client = httpx.AsyncClient(timeout=timeout)
yield
# 关闭时的代码
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_matching_providers(self, model_name, token):
async def request_model(self, request: RequestModel, token: str):
model_name = request.model
matching_providers = self.get_matching_providers(model_name, token)
print("matching_providers", json.dumps(matching_providers, indent=4, ensure_ascii=False))
# print("matching_providers", json.dumps(matching_providers, indent=4, ensure_ascii=False))

if not matching_providers:
raise HTTPException(status_code=404, detail="No matching model found")
Expand Down

0 comments on commit 4bd89b8

Please sign in to comment.