mirror of https://github.com/THUDM/ChatGLM-6B
load model from local
parent
da9dfee3ef
commit
0685b56bc1
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue