pinkyponky
commited on
Commit
•
bb3b052
1
Parent(s):
89d18f6
Update README.md
Browse files
README.md
CHANGED
@@ -3,3 +3,32 @@ license: cc-by-nc-4.0
|
|
3 |
---
|
4 |
|
5 |
Discription to load and test will be added soon. More details on training and data will be added aswell.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
4 |
|
5 |
Discription to load and test will be added soon. More details on training and data will be added aswell.
|
6 |
+
|
7 |
+
|
8 |
+
### **Loading the Model**
|
9 |
+
|
10 |
+
Use the following Python code to load the model:
|
11 |
+
|
12 |
+
```python
|
13 |
+
import torch
|
14 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
15 |
+
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained("pinkyponky/SOLAR-10.7B-dpo-instruct-tuned-v0.1")
|
17 |
+
model = AutoModelForCausalLM.from_pretrained(
|
18 |
+
"Upstage/SOLAR-10.7B-v1.0",
|
19 |
+
device_map="auto",
|
20 |
+
torch_dtype=torch.bfloat16,
|
21 |
+
)
|
22 |
+
```
|
23 |
+
|
24 |
+
### **Generating Text**
|
25 |
+
|
26 |
+
To generate text, use the following Python code:
|
27 |
+
|
28 |
+
```python
|
29 |
+
text = "Hi, my name is "
|
30 |
+
inputs = tokenizer(text, return_tensors="pt")
|
31 |
+
|
32 |
+
outputs = model.generate(**inputs, max_new_tokens=64)
|
33 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
34 |
+
```
|