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