Update README.md
Browse files
README.md
CHANGED
|
@@ -32,10 +32,10 @@ To load and run ChemDFM locally, here is an example:
|
|
| 32 |
|
| 33 |
```python
|
| 34 |
import torch
|
| 35 |
-
from transformers import
|
| 36 |
|
| 37 |
model_name_or_id = "OpenDFM/ChemDFM-v1.5-8B"
|
| 38 |
-
tokenizer =
|
| 39 |
model = LlamaForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.float16, device_map="auto")
|
| 40 |
|
| 41 |
input_text = "Can you please give detailed descriptions of the molecule below?\nCl.O=C1c2c(O)cccc2-c2nn(CCNCCO)c3ccc(NCCNCCO)c1c23"
|
|
|
|
| 32 |
|
| 33 |
```python
|
| 34 |
import torch
|
| 35 |
+
from transformers import AutoTokenizer, LlamaForCausalLM, GenerationConfig
|
| 36 |
|
| 37 |
model_name_or_id = "OpenDFM/ChemDFM-v1.5-8B"
|
| 38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_id)
|
| 39 |
model = LlamaForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.float16, device_map="auto")
|
| 40 |
|
| 41 |
input_text = "Can you please give detailed descriptions of the molecule below?\nCl.O=C1c2c(O)cccc2-c2nn(CCNCCO)c3ccc(NCCNCCO)c1c23"
|