Merge pull request #17 from myml/memory

fix: 修复chatglm模型被复制,显存占用过多
This commit is contained in:
imClumsyPanda 2023-04-07 09:43:49 +08:00 committed by GitHub
commit 63d900607f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ model = (
.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()
class ChatGLM(LLM):
max_token: int = 10000