Update README.md
Browse files
README.md
CHANGED
@@ -11,6 +11,33 @@ tags:
|
|
11 |
- trl
|
12 |
---
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
# Uploaded model
|
15 |
|
16 |
- **Developed by:** Chimmyy
|
|
|
11 |
- trl
|
12 |
---
|
13 |
|
14 |
+
# How to Use
|
15 |
+
```bash
|
16 |
+
from unsloth import FastLanguageModel
|
17 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
18 |
+
model_name = "Chimmyy/Llama3.1-8B-Finance",
|
19 |
+
max_seq_length = 1024,
|
20 |
+
dtype = None,
|
21 |
+
load_in_4bit = True,
|
22 |
+
)
|
23 |
+
FastLanguageModel.for_inference(model)
|
24 |
+
inputs = tokenizer(
|
25 |
+
[
|
26 |
+
prompt.format(
|
27 |
+
"What are the advantages of investing in bonds?", # instruction
|
28 |
+
"", # input
|
29 |
+
"", # output - leave empty for model
|
30 |
+
)
|
31 |
+
], return_tensors = "pt").to("cuda")
|
32 |
+
|
33 |
+
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True) # Change max_new_tokens as needed
|
34 |
+
result = tokenizer.batch_decode(outputs)
|
35 |
+
print(result)
|
36 |
+
|
37 |
+
|
38 |
+
```
|
39 |
+
|
40 |
+
|
41 |
# Uploaded model
|
42 |
|
43 |
- **Developed by:** Chimmyy
|