update requirements

Former-commit-id: 66a91e1fe3
This commit is contained in:
hiyouga
2023-11-06 19:01:21 +08:00
parent 5c19786f7c
commit 936297aeac
4 changed files with 8 additions and 9 deletions

View File

@@ -32,9 +32,9 @@ async def lifespan(app: FastAPI): # collects GPU memory
def to_json(data: BaseModel) -> str:
try:
try: # pydantic v2
return json.dumps(data.model_dump(exclude_unset=True), ensure_ascii=False)
except:
except: # pydantic v1
return data.json(exclude_unset=True, ensure_ascii=False)