Commit
·
0daf33b
1
Parent(s):
36d42b4
Update README.md
Browse files
README.md
CHANGED
|
@@ -50,14 +50,13 @@ We tested the results of Zero-shot and Five-shot respectively. Our 7B and 14B se
|
|
| 50 |
# Quickstart
|
| 51 |
We provide simple examples to illustrate how to quickly use Devops-Model-Chat models with 🤗 Transformers.
|
| 52 |
|
| 53 |
-
##
|
| 54 |
-
下载模型后,直接通过以下命令安装 requirements.txt 中的包就可以
|
| 55 |
```bash
|
| 56 |
cd path_to_download_model
|
| 57 |
pip install -r requirements.txt
|
| 58 |
```
|
| 59 |
|
| 60 |
-
##
|
| 61 |
|
| 62 |
```python
|
| 63 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
@@ -69,7 +68,10 @@ model = AutoModelForCausalLM.from_pretrained("path_to_DevOps-Model", device_map=
|
|
| 69 |
|
| 70 |
model.generation_config = GenerationConfig.from_pretrained("path_to_DevOps-Model", trust_remote_code=True)
|
| 71 |
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
| 73 |
```
|
| 74 |
|
| 75 |
|
|
|
|
| 50 |
# Quickstart
|
| 51 |
We provide simple examples to illustrate how to quickly use Devops-Model-Chat models with 🤗 Transformers.
|
| 52 |
|
| 53 |
+
## Requirement
|
|
|
|
| 54 |
```bash
|
| 55 |
cd path_to_download_model
|
| 56 |
pip install -r requirements.txt
|
| 57 |
```
|
| 58 |
|
| 59 |
+
## Model Example
|
| 60 |
|
| 61 |
```python
|
| 62 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 68 |
|
| 69 |
model.generation_config = GenerationConfig.from_pretrained("path_to_DevOps-Model", trust_remote_code=True)
|
| 70 |
|
| 71 |
+
inputs = '''The implementation principle of HashMap in Java is'''
|
| 72 |
+
input_ids = tokenizer(inputs, return_tensors='pt')
|
| 73 |
+
input_ids = input_ids.to(model.device)
|
| 74 |
+
pred = model.generate(**input_ids)
|
| 75 |
```
|
| 76 |
|
| 77 |
|