修复api服务启动错误

第31行【API】->【api】会因为大小写原因找不到API
第34行的下划线【chatglm_6b】->【chatglm-6b】会导致模型加载错误
pull/221/head
ZhangErling 2023-03-24 15:33:42 +08:00 committed by GitHub
parent 955d475079
commit acbc2e178a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

4
api.py
View File

@ -28,8 +28,8 @@ async def create_item(request: Request):
if __name__ == '__main__':
uvicorn.run('API:app', host='0.0.0.0', port=8000, workers=1)
uvicorn.run('api: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 = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
model.eval()