yym68686 commited on
Commit
4bd89b8
·
1 Parent(s): aa42078

Increase the initial character read timeout.

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -20,7 +20,7 @@ from fastapi.middleware.cors import CORSMiddleware
20
  @asynccontextmanager
21
  async def lifespan(app: FastAPI):
22
  # 启动时的代码
23
- timeout = httpx.Timeout(connect=15.0, read=5.0, write=30.0, pool=30.0)
24
  app.state.client = httpx.AsyncClient(timeout=timeout)
25
  yield
26
  # 关闭时的代码
@@ -114,7 +114,7 @@ class ModelRequestHandler:
114
  async def request_model(self, request: RequestModel, token: str):
115
  model_name = request.model
116
  matching_providers = self.get_matching_providers(model_name, token)
117
- print("matching_providers", json.dumps(matching_providers, indent=4, ensure_ascii=False))
118
 
119
  if not matching_providers:
120
  raise HTTPException(status_code=404, detail="No matching model found")
 
20
  @asynccontextmanager
21
  async def lifespan(app: FastAPI):
22
  # 启动时的代码
23
+ timeout = httpx.Timeout(connect=15.0, read=10.0, write=30.0, pool=30.0)
24
  app.state.client = httpx.AsyncClient(timeout=timeout)
25
  yield
26
  # 关闭时的代码
 
114
  async def request_model(self, request: RequestModel, token: str):
115
  model_name = request.model
116
  matching_providers = self.get_matching_providers(model_name, token)
117
+ # print("matching_providers", json.dumps(matching_providers, indent=4, ensure_ascii=False))
118
 
119
  if not matching_providers:
120
  raise HTTPException(status_code=404, detail="No matching model found")