From 24ca4020814e11e4aa7facc277e343d2aa3725eb Mon Sep 17 00:00:00 2001 From: Shuo Zhang Date: Thu, 6 Jul 2023 16:20:59 +0800 Subject: [PATCH] Update README-zh-Hans.md --- README-zh-Hans.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh-Hans.md b/README-zh-Hans.md index 38a113b..16312f2 100644 --- a/README-zh-Hans.md +++ b/README-zh-Hans.md @@ -74,9 +74,9 @@ InternLM ,即书生·浦语大模型,包含面向实用场景的70亿参数 ### 通过 Transformers 加载 通过以下的代码加载 InternLM 7B Chat 模型 ```python ->>> from transformers import AutoTokenizer, AutoModel +>>> from transformers import AutoTokenizer, AutoModelForCausalLM >>> tokenizer = AutoTokenizer.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True) ->>> model = AutoModel.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True, device='cuda') +>>> model = AutoModelForCausalLM.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True, device='cuda') >>> model = model.eval() >>> response, history = model.chat(tokenizer, "你好", history=[]) >>> print(response)