pankajmathur commited on
Commit
9d788b7
·
verified ·
1 Parent(s): 0dd1d52

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +108 -0
README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama3.2
3
+ language:
4
+ - en
5
+ base_model:
6
+ - meta-llama/Llama-3.2-1B-Instruct
7
+ library_name: transformers
8
+ ---
9
+ # Model Name: Orca_Mini_v9_1_Llama-3.2-1B-Instruct
10
+
11
+ **Orca_Mini_v9_1_Llama-3.2-1B-Instruct is trained with various SFT Datasets on [Llama-3.2-1B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct)**
12
+
13
+ <img src="https://huggingface.co/pankajmathur/orca_mini_v5_8b/resolve/main/orca_minis_small.jpeg" width="auto" />
14
+
15
+ <strong>
16
+ Passionate about Generative AI?, Let's Connect! <a href="https://www.linkedin.com/in/pankajam" target="_blank">https://www.linkedin.com/in/pankajam</a>
17
+ </strong>
18
+
19
+ <br>
20
+
21
+ ### NOTICE
22
+ By providing proper credit and attribution, you are granted permission to use this model as a foundational base for further Full fine tuning, DPO, PPO or ORPO tuning and any kind of Merges.
23
+ I actively encourage users to customize and enhance the model according to their specific needs, as this version is designed to be a comprehensive general model.
24
+ Dive in and innovate!
25
+
26
+
27
+ ### Example Usage
28
+ Here is the Llama3 prompt format
29
+ ```
30
+ <|begin_of_text|><|start_header_id|>system<|end_header_id|>
31
+ You are Orca Mini, a helpful AI assistant.<|eot_id|>
32
+ <|start_header_id|>user<|end_header_id|>
33
+ Hello Orca Mini, what can you do for me?<|eot_id|>
34
+ <|start_header_id|>assistant<|end_header_id|>
35
+ ```
36
+
37
+ Below shows a code example on how to use this model in default half precision (bfloat16) format
38
+
39
+ ```python
40
+ import torch
41
+ from transformers import pipeline
42
+
43
+ model_slug = "pankajmathur/orca_mini_v9_1_1B-Instruct"
44
+ pipeline = pipeline(
45
+ "text-generation",
46
+ model=model_slug,
47
+ device_map="auto",
48
+ )
49
+ messages = [
50
+ {"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
51
+ {"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
52
+ ]
53
+ outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
54
+ print(outputs[0]["generated_text"][-1])
55
+ ```
56
+
57
+ Below shows a code example on how to use this model in 4-bit format via bitsandbytes library
58
+
59
+ ```python
60
+ import torch
61
+ from transformers import BitsAndBytesConfig, pipeline
62
+
63
+ model_slug = "pankajmathur/orca_mini_v9_1_1B-Instruct"
64
+ quantization_config = BitsAndBytesConfig(
65
+ load_in_4bit=True,
66
+ bnb_4bit_quant_type="nf4",
67
+ bnb_4bit_compute_dtype="float16",
68
+ bnb_4bit_use_double_quant=True,
69
+ )
70
+ pipeline = pipeline(
71
+ "text-generation",
72
+ model=model_slug,
73
+ model_kwargs={"quantization_config": quantization_config},
74
+ device_map="auto",
75
+ )
76
+ messages = [
77
+ {"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
78
+ {"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
79
+ ]
80
+ outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
81
+ print(outputs[0]["generated_text"][-1])
82
+
83
+ ```
84
+
85
+ Below shows a code example on how to use this model in 8-bit format via bitsandbytes library
86
+
87
+ ```python
88
+ import torch
89
+ from transformers import BitsAndBytesConfig, pipeline
90
+
91
+ model_slug = "pankajmathur/orca_mini_v9_1_1B-Instruct"
92
+ quantization_config = BitsAndBytesConfig(
93
+ load_in_8bit=True
94
+ )
95
+ pipeline = pipeline(
96
+ "text-generation",
97
+ model=model_slug,
98
+ model_kwargs={"quantization_config": quantization_config},
99
+ device_map="auto",
100
+ )
101
+ messages = [
102
+ {"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
103
+ {"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
104
+ ]
105
+ outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
106
+ print(outputs[0]["generated_text"][-1])
107
+
108
+ ```