DipeshChaudhary
commited on
Commit
•
c99e77d
1
Parent(s):
22ecf09
Update README.md
Browse files
README.md
CHANGED
@@ -17,12 +17,33 @@ base_model: unsloth/llama-3-8b-Instruct-bnb-4bit
|
|
17 |
**STEP 1:**
|
18 |
- Installs Unsloth, Xformers (Flash Attention) and all other packages! according to your environments and GPU
|
19 |
- To install Unsloth on your own computer, follow the installation instructions on our Github page : [LINK IS HERE](https://github.com/unslothai/unsloth#installation-instructions---conda)
|
|
|
20 |
**Now Follow the CODE**
|
21 |
```markdown
|
22 |
```
|
23 |
-
```
|
24 |
from unsloth import FastLanguageModel
|
25 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
```
|
27 |
|
28 |
# Uploaded model
|
|
|
17 |
**STEP 1:**
|
18 |
- Installs Unsloth, Xformers (Flash Attention) and all other packages! according to your environments and GPU
|
19 |
- To install Unsloth on your own computer, follow the installation instructions on our Github page : [LINK IS HERE](https://github.com/unslothai/unsloth#installation-instructions---conda)
|
20 |
+
|
21 |
**Now Follow the CODE**
|
22 |
```markdown
|
23 |
```
|
|
|
24 |
from unsloth import FastLanguageModel
|
25 |
```
|
26 |
+
import torch
|
27 |
+
max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
|
28 |
+
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
|
29 |
+
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
|
30 |
+
from transformers import AutoTokenizer
|
31 |
+
```
|
32 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
33 |
+
model_name="DipeshChaudhary/ShareGPTChatBot-Counselchat1", # Your fine-tuned model
|
34 |
+
max_seq_length=max_seq_length,
|
35 |
+
dtype=dtype,
|
36 |
+
load_in_4bit=load_in_4bit,
|
37 |
+
)
|
38 |
+
```
|
39 |
+
#We now use the Llama-3 format for conversation style finetunes. We use Open Assistant conversations in ShareGPT style.
|
40 |
+
**We use our get_chat_template function to get the correct chat template. They support zephyr, chatml, mistral, llama, alpaca, vicuna, vicuna_old and their own optimized unsloth template**
|
41 |
+
from unsloth.chat_templates import get_chat_template
|
42 |
+
tokenizer = get_chat_template(
|
43 |
+
tokenizer,
|
44 |
+
chat_template = "llama-3", # Supports zephyr, chatml, mistral, llama, alpaca, vicuna, vicuna_old, unsloth
|
45 |
+
mapping = {"role" : "from", "content" : "value", "user" : "human", "assistant" : "gpt"}, # ShareGPT style
|
46 |
+
)
|
47 |
```
|
48 |
|
49 |
# Uploaded model
|