Skip to content

Commit

Permalink
[doc] Add the requirement for the transformers library version in usa…
Browse files Browse the repository at this point in the history
…ge section (InternLM#658)
  • Loading branch information
del-zhenwu authored Jan 25, 2024
1 parent c1ecc0d commit 1cb9870
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ The release of InternLM2 series contains two model sizes: 7B and 20B. 7B models

We briefly show the usages with [Transformers](#import-from-transformers), [ModelScope](#import-from-modelscope), and [Web demos](#dialogue).
The chat models adopt [chatml format](./chat/chat_format.md) to support both chat and agent applications.

To ensure a better usage effect, please make sure that the installed transformers library version meets the following requirements before performing inference with [Transformers](#import-from-transformers) or [ModelScope](#import-from-modelscope):
```
transformers >= 4.34
```
### Import from Transformers

To load the InternLM2-7B-Chat model using Transformers, use the following code:
Expand Down Expand Up @@ -181,7 +184,7 @@ You can interact with the InternLM Chat 7B model through a frontend interface by

```bash
pip install streamlit==1.24.0
pip install transformers==4.30.2
pip install transformers>=4.34
streamlit run ./chat/web_demo.py
```

Expand Down
7 changes: 5 additions & 2 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ InternLM2 系列模型在本仓库正式发布,具有如下特性:

接下来我们展示使用 [Transformers](#import-from-transformers)[ModelScope](#import-from-modelscope)[Web demo](#dialogue) 进行推理。
对话模型采用了 [chatml 格式](./chat/chat_format.md) 来支持通用对话和智能体应用。

为了保障更好的使用效果,在用 [Transformers](#import-from-transformers)[ModelScope](#import-from-modelscope) 进行推理前,请确保安装的 transformers 库版本满足以下要求:
```
transformers >= 4.34
```
### 通过 Transformers 加载

通过以下的代码从 Transformers 加载 InternLM2-7B-Chat 模型 (可修改模型名称替换不同的模型)
Expand Down Expand Up @@ -178,7 +181,7 @@ print(response)

```bash
pip install streamlit==1.24.0
pip install transformers==4.30.2
pip install transformers>=4.34
streamlit run ./chat/web_demo.py
```

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
transformers<4.30.0
transformers>=4.34
sentencepiece

0 comments on commit 1cb9870

Please sign in to comment.