JoeyHeisenberg
commited on
Commit
•
7637563
1
Parent(s):
91ca2cc
Update README.md
Browse files
README.md
CHANGED
@@ -52,13 +52,11 @@ We tested our BlueLM-7B-Chat-32K on the LongBench dataset and the results are s
|
|
52 |
>>> tokenizer = AutoTokenizer.from_pretrained("vivo-ai/BlueLM-7B-Chat-32K", trust_remote_code=True, use_fast=False)
|
53 |
>>> model = AutoModelForCausalLM.from_pretrained("vivo-ai/BlueLM-7B-Chat-32K", device_map="cuda:0", torch_dtype=torch.bfloat16, trust_remote_code=True)
|
54 |
>>> model = model.eval()
|
55 |
-
>>> inputs = tokenizer("
|
56 |
>>> inputs = inputs.to("cuda:0")
|
57 |
>>> pred = model.generate(**inputs, max_new_tokens=64, repetition_penalty=1.1)
|
58 |
>>> print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))
|
59 |
-
|
60 |
-
隋唐演义->褚人获
|
61 |
-
红楼梦->曹雪芹
|
62 |
```
|
63 |
|
64 |
更多使用说明,请参考我们的 [Github 仓库](https://github.com/vivo-ai-lab/BlueLM)。
|
|
|
52 |
>>> tokenizer = AutoTokenizer.from_pretrained("vivo-ai/BlueLM-7B-Chat-32K", trust_remote_code=True, use_fast=False)
|
53 |
>>> model = AutoModelForCausalLM.from_pretrained("vivo-ai/BlueLM-7B-Chat-32K", device_map="cuda:0", torch_dtype=torch.bfloat16, trust_remote_code=True)
|
54 |
>>> model = model.eval()
|
55 |
+
>>> inputs = tokenizer("[|Human|]:三国演义的作者是谁?[|AI|]:", return_tensors="pt")
|
56 |
>>> inputs = inputs.to("cuda:0")
|
57 |
>>> pred = model.generate(**inputs, max_new_tokens=64, repetition_penalty=1.1)
|
58 |
>>> print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))
|
59 |
+
三国演义的作者是谁? 《三国演义》的作者是明代小说家罗贯中。
|
|
|
|
|
60 |
```
|
61 |
|
62 |
更多使用说明,请参考我们的 [Github 仓库](https://github.com/vivo-ai-lab/BlueLM)。
|