Update README.md
Browse files
README.md
CHANGED
@@ -63,9 +63,11 @@ Checkpoints format: Hugging Face Transformers (Megatron-DeepSpeed format models
|
|
63 |
|
64 |
```python
|
65 |
import torch
|
66 |
-
from transformers import AutoTokenizer
|
|
|
|
|
67 |
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-13b-dpo-lora-hh_rlhf_ja-v1.1")
|
68 |
-
model =
|
69 |
text = "δ»₯δΈγ―γγΏγΉγ―γθͺ¬ζγγζη€Ίγ§γγθ¦ζ±γι©εγ«ζΊγγεΏηγζΈγγͺγγγ\n\n### ζη€Ί:\n{instruction}\n\n### εΏη:\n".format(instruction="θͺηΆθ¨θͺε¦ηγ¨γ―δ½γ")
|
70 |
tokenized_input = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt").to(model.device)
|
71 |
with torch.no_grad():
|
|
|
63 |
|
64 |
```python
|
65 |
import torch
|
66 |
+
from transformers import AutoTokenizer
|
67 |
+
from peft import AutoPeftModelForCausalLM
|
68 |
+
|
69 |
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-13b-dpo-lora-hh_rlhf_ja-v1.1")
|
70 |
+
model = AutoPeftModelForCausalLM.from_pretrained("llm-jp/llm-jp-13b-dpo-lora-hh_rlhf_ja-v1.1", device_map="auto", torch_dtype=torch.float16)
|
71 |
text = "δ»₯δΈγ―γγΏγΉγ―γθͺ¬ζγγζη€Ίγ§γγθ¦ζ±γι©εγ«ζΊγγεΏηγζΈγγͺγγγ\n\n### ζη€Ί:\n{instruction}\n\n### εΏη:\n".format(instruction="θͺηΆθ¨θͺε¦ηγ¨γ―δ½γ")
|
72 |
tokenized_input = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt").to(model.device)
|
73 |
with torch.no_grad():
|