Update README.md
Browse files
README.md
CHANGED
|
@@ -26,7 +26,7 @@ The additional details of the Aquila model will be presented in the official tec
|
|
| 26 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 27 |
import torch
|
| 28 |
device = torch.device("cuda:0")
|
| 29 |
-
model_info = "BAAI/AquilaChat2-
|
| 30 |
tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
|
| 31 |
model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 32 |
model.eval()
|
|
@@ -35,7 +35,7 @@ text = "请给出10个要到北京旅游的理由。"
|
|
| 35 |
from predict import predict
|
| 36 |
out = predict(model, text, tokenizer=tokenizer, max_gen_len=200, top_p=0.95,
|
| 37 |
seed=1234, topk=100, temperature=0.9, sft=True, device=device,
|
| 38 |
-
model_name="AquilaChat2-
|
| 39 |
print(out)
|
| 40 |
```
|
| 41 |
|
|
|
|
| 26 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 27 |
import torch
|
| 28 |
device = torch.device("cuda:0")
|
| 29 |
+
model_info = "BAAI/AquilaChat2-7B"
|
| 30 |
tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
|
| 31 |
model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 32 |
model.eval()
|
|
|
|
| 35 |
from predict import predict
|
| 36 |
out = predict(model, text, tokenizer=tokenizer, max_gen_len=200, top_p=0.95,
|
| 37 |
seed=1234, topk=100, temperature=0.9, sft=True, device=device,
|
| 38 |
+
model_name="AquilaChat2-7B")
|
| 39 |
print(out)
|
| 40 |
```
|
| 41 |
|