diff --git a/api_stream.py b/api_stream.py index 1e987ec..3bb649f 100644 --- a/api_stream.py +++ b/api_stream.py @@ -95,9 +95,14 @@ 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() + #tokenizer = AutoTokenizer.from_pretrained( + # "THUDM/chatglm-6b", trust_remote_code=True) + #model = AutoModel.from_pretrained( + # "THUDM/chatglm-6b", trust_remote_code=True).half().cuda() + # mkdir model + # cp ~/.cache/huggingface/hub/models--THUDM--chatglm-6b/snapshots/658202d88ac4bb782b99e99ac3adff58b4d0b813 ./model + model_path = "./model/" + tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True) + model = AutoModel.from_pretrained(model_path, trust_remote_code=True).half().cuda() model.eval() uvicorn.run(app, host='0.0.0.0', port=8000, workers=1)