Merge pull request #569 from zhipuch/main

update readme
This commit is contained in:
Yuxuan.Zhang 2024-09-26 13:52:20 +08:00 committed by GitHub
commit 23773d94e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -142,5 +142,15 @@ python openai_api_request.py
python trans_stress_test.py
```
## 使用昇腾卡运行代码
用户可以在昇腾硬件环境下运行以上代码只需将transformers修改为openmind将device中的cuda设备修改为npu
```shell
#from transformers import AutoModelForCausalLM, AutoTokenizer
from openmind import AutoModelForCausalLM, AutoTokenizer
#device = 'cuda'
device = 'npu'
```

View File

@ -147,3 +147,15 @@ Users can use this code to test the generation speed of the model on the transfo
```shell
python trans_stress_test.py
```
## Use Ascend card to run code
Users can run the above code in the Ascend hardware environment. They only need to change the transformers to openmind and the cuda device in device to npu.
```shell
#from transformers import AutoModelForCausalLM, AutoTokenizer
from openmind import AutoModelForCausalLM, AutoTokenizer
#device = 'cuda'
device = 'npu'
```