Fix typos

Move model instantiation
dev_api
duzx16 2023-03-28 19:45:17 +08:00
parent 1c6002f3f1
commit c6790a09f0
1 changed files with 3 additions and 4 deletions

7
api.py
View File

@ -50,8 +50,7 @@ async def create_item(request: Request):
if __name__ == '__main__':
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
model.eval()
uvicorn.run(app, host='0.0.0.0', port=8000, workers=1)
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm_6b", trust_remote_code=True).half().cuda()
model.eval()