prithivMLmods commited on
Commit
33e9b1d
1 Parent(s): 60bc168

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +199 -0
README.md CHANGED
@@ -17,4 +17,203 @@ tags:
17
  - OpenO1
18
  - text-generation-inference
19
  - Question Answering
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ---
 
17
  - OpenO1
18
  - text-generation-inference
19
  - Question Answering
20
+ ---
21
+
22
+ ### Llama-3.1-8B-Open-SFT-GGUF
23
+
24
+ The **Llama-3.1-8B-Open-SFT** model is a fine-tuned version of **meta-llama/Llama-3.1-8B-Instruct**, designed for advanced text generation tasks, including conversational interactions, question answering, and chain-of-thought reasoning. This model leverages **Supervised Fine-Tuning (SFT)** using the **O1-OPEN/OpenO1-SFT** dataset to provide enhanced performance in context-sensitive and instruction-following tasks.
25
+
26
+ | **File Name** | **Size** | **Description** | **Upload Status** |
27
+ |------------------------------------|-------------------|---------------------------------------------------|-------------------|
28
+ | `.gitattributes` | 1.79 kB | LFS tracking configuration for model files. | Uploaded |
29
+ | `Llama-3.1-8B-Open-SFT.F16.gguf` | 16.1 GB | Full-precision FP16 version of the model. | Uploaded (LFS) |
30
+ | `Llama-3.1-8B-Open-SFT.Q4_K_M.gguf`| 4.92 GB | Quantized (Q4_K_M) version of the model. | Uploaded (LFS) |
31
+ | `Llama-3.1-8B-Open-SFT.Q5_K_M.gguf`| 5.73 GB | Quantized (Q5_K_M) version of the model. | Uploaded (LFS) |
32
+ | `Llama-3.1-8B-Open-SFT.Q8_0.gguf` | 8.54 GB | Quantized (Q8_0) version of the model. | Uploaded (LFS) |
33
+ | `README.md` | 318 Bytes | Minimal information. | Uploaded |
34
+ | `config.json` | 29 Bytes | Basic model metadata configuration. | Uploaded |
35
+
36
+ ---
37
+ ### **Key Features**
38
+
39
+ 1. **Text Generation with CoT Reasoning:**
40
+ - Implements **Chain-of-Thought (CoT)** prompting for logical and step-by-step reasoning tasks.
41
+
42
+ 2. **Conversational AI:**
43
+ - Excels in generating context-aware and coherent responses in multi-turn conversations.
44
+
45
+ 3. **Supervised Fine-Tuning (SFT):**
46
+ - Optimized for open-domain tasks using the **O1-OPEN/OpenO1-SFT** dataset.
47
+
48
+ 4. **Multi-Purpose Functionality:**
49
+ - Supports a wide range of NLP tasks, including summarization, question answering, and text completion.
50
+
51
+ 5. **Scalable Sharded Architecture:**
52
+ - Model weights are distributed across four shards, ensuring efficient loading for large-scale applications.
53
+
54
+ ---
55
+
56
+ ### **Training Details**
57
+
58
+ - **Base Model:** [meta-llama/Llama-3.1-8B](#)
59
+ - **Finetuned Dataset:** [O1-OPEN/OpenO1-SFT](#)
60
+ - Dataset includes **77.7k** fine-tuning samples, curated for instruction-based and open-domain tasks.
61
+
62
+ - **Model Size:**
63
+ - 8 Billion parameters distributed over 4 shards for efficient deployment.
64
+
65
+ ### **Applications**
66
+
67
+ 1. **Chain-of-Thought (CoT) Reasoning:**
68
+ - Solve complex problems step-by-step with logical reasoning capabilities.
69
+
70
+ 2. **Conversational Agents:**
71
+ - Ideal for chatbots, virtual assistants, and conversational systems.
72
+
73
+ 3. **Question Answering:**
74
+ - Answer open-domain or context-specific questions accurately.
75
+
76
+ 4. **Text Completion:**
77
+ - Generate coherent continuations for incomplete inputs.
78
+
79
+ 5. **Creative Writing:**
80
+ - Support for generating stories, articles, or brainstorming ideas.
81
+
82
+ ---
83
+
84
+ ### **Usage**
85
+
86
+ #### **Loading the Model**
87
+ ```python
88
+ from transformers import AutoModelForCausalLM, AutoTokenizer
89
+
90
+ model_name = "prithivMLmods/Llama-3.1-8B-Open-SFT"
91
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
92
+ model = AutoModelForCausalLM.from_pretrained(model_name)
93
+ ```
94
+
95
+ ---
96
+
97
+ #### **Inference Example**
98
+ ```python
99
+ prompt = """
100
+ Explain the concept of gravity in a simple way suitable for a 10-year-old:
101
+ """
102
+ inputs = tokenizer(prompt, return_tensors="pt")
103
+ outputs = model.generate(**inputs, max_length=150, temperature=0.7)
104
+
105
+ response = tokenizer.decode(outputs[0], skip_special_tokens=True)
106
+ print("Model Output:", response)
107
+ ```
108
+
109
+ ---
110
+
111
+ ### **Expected Output**
112
+ **"Gravity is a force that pulls things toward each other. It's the reason why things fall to the ground when you drop them. On Earth, gravity keeps us on the ground and makes sure everything stays in place, like your toys, the water in the ocean, and even the air we breathe."**
113
+
114
+ ---
115
+
116
+ ### **Performance Requirements**
117
+
118
+ - **Hardware:**
119
+ - High-performance GPUs are recommended for efficient inference.
120
+ - Minimum memory: ~16GB VRAM for full precision; 8GB for quantized models.
121
+
122
+ - **Optimization Options:**
123
+ - Use `Safetensors` for secure and efficient weight loading.
124
+ - Quantization or model parallelism for resource-constrained environments.
125
+
126
+ ---
127
+
128
+ # Run with Ollama [ Ollama Run ]
129
+
130
+ ## Overview
131
+
132
+ Ollama is a powerful tool that allows you to run machine learning models effortlessly. This guide will help you download, install, and run your own GGUF models in just a few minutes.
133
+
134
+ ## Table of Contents
135
+
136
+ - [Download and Install Ollama](#download-and-install-ollama)
137
+ - [Steps to Run GGUF Models](#steps-to-run-gguf-models)
138
+ - [1. Create the Model File](#1-create-the-model-file)
139
+ - [2. Add the Template Command](#2-add-the-template-command)
140
+ - [3. Create and Patch the Model](#3-create-and-patch-the-model)
141
+ - [Running the Model](#running-the-model)
142
+ - [Sample Usage](#sample-usage)
143
+
144
+ ## Download and Install Ollama🦙
145
+
146
+ To get started, download Ollama from [https://ollama.com/download](https://ollama.com/download) and install it on your Windows or Mac system.
147
+
148
+ ## Steps to Run GGUF Models
149
+
150
+ ### 1. Create the Model File
151
+ First, create a model file and name it appropriately. For example, you can name your model file `metallama`.
152
+
153
+ ### 2. Add the Template Command
154
+ In your model file, include a `FROM` line that specifies the base model file you want to use. For instance:
155
+
156
+ ```bash
157
+ FROM Llama-3.2-1B.F16.gguf
158
+ ```
159
+
160
+ Ensure that the model file is in the same directory as your script.
161
+
162
+ ### 3. Create and Patch the Model
163
+ Open your terminal and run the following command to create and patch your model:
164
+
165
+ ```bash
166
+ ollama create metallama -f ./metallama
167
+ ```
168
+
169
+ Once the process is successful, you will see a confirmation message.
170
+
171
+ To verify that the model was created successfully, you can list all models with:
172
+
173
+ ```bash
174
+ ollama list
175
+ ```
176
+
177
+ Make sure that `metallama` appears in the list of models.
178
+
179
+ ---
180
+
181
+ ## Running the Model
182
+
183
+ To run your newly created model, use the following command in your terminal:
184
+
185
+ ```bash
186
+ ollama run metallama
187
+ ```
188
+
189
+ ### Sample Usage / Test
190
+
191
+ In the command prompt, you can execute:
192
+
193
+ ```bash
194
+ D:\>ollama run metallama
195
+ ```
196
+
197
+ You can interact with the model like this:
198
+
199
+ ```plaintext
200
+ >>> write a mini passage about space x
201
+ Space X, the private aerospace company founded by Elon Musk, is revolutionizing the field of space exploration.
202
+ With its ambitious goals to make humanity a multi-planetary species and establish a sustainable human presence in
203
+ the cosmos, Space X has become a leading player in the industry. The company's spacecraft, like the Falcon 9, have
204
+ demonstrated remarkable capabilities, allowing for the transport of crews and cargo into space with unprecedented
205
+ efficiency. As technology continues to advance, the possibility of establishing permanent colonies on Mars becomes
206
+ increasingly feasible, thanks in part to the success of reusable rockets that can launch multiple times without
207
+ sustaining significant damage. The journey towards becoming a multi-planetary species is underway, and Space X
208
+ plays a pivotal role in pushing the boundaries of human exploration and settlement.
209
+ ```
210
+ ---
211
+
212
+ ## Conclusion
213
+
214
+ With these simple steps, you can easily download, install, and run your own models using Ollama. Whether you're exploring the capabilities of Llama or building your own custom models, Ollama makes it accessible and efficient.
215
+
216
+
217
+ - This README provides clear instructions and structured information to help users navigate the process of using Ollama effectively. Adjust any sections as needed based on your specific requirements or additional details you may want to include.
218
+
219
  ---