Blazewild commited on
Commit
aa1bc4b
·
1 Parent(s): a1cd22a

updated readme

Browse files
Files changed (1) hide show
  1. README.md +55 -250
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Trek Nepal 3B
3
  emoji: 🏔️
4
  colorFrom: blue
5
  colorTo: green
@@ -29,284 +29,89 @@ license: apache-2.0
29
 
30
  # Trek Nepal 3B - Fine-tuned Llama-3.2-3B for Nepal Trekking
31
 
32
- This model is a fine-tuned version of [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct) specifically trained on Nepal trekking and travel information.
33
 
34
- ## Model Details
35
 
36
- - **Base Model**: meta-llama/Llama-3.2-3B-Instruct
37
- - **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
38
- - **LoRA Rank**: 256
39
- - **LoRA Alpha**: 512
40
- - **Specialization**: Nepal trekking routes, permits, gear, weather, safety, accommodation, costs, and preparation
41
-
42
- ### Model Description
43
-
44
- <!-- Provide a longer summary of what this model is. -->
45
-
46
- - **Developed by:** [More Information Needed]
47
- - **Funded by [optional]:** [More Information Needed]
48
- - **Shared by [optional]:** [More Information Needed]
49
- - **Model type:** [More Information Needed]
50
- - **Language(s) (NLP):** [More Information Needed]
51
- - **License:** [More Information Needed]
52
- - **Finetuned from model [optional]:** [More Information Needed]
53
-
54
- ### Model Sources [optional]
55
-
56
- <!-- Provide the basic links for the model. -->
57
-
58
- - **Repository:** [More Information Needed]
59
- - **Paper [optional]:** [More Information Needed]
60
- - **Demo [optional]:** [More Information Needed]
61
-
62
- ## Uses
63
-
64
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
65
-
66
- ### Direct Use
67
-
68
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
69
-
70
- [More Information Needed]
71
-
72
- ### Downstream Use [optional]
73
-
74
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
75
-
76
- [More Information Needed]
77
-
78
- ### Out-of-Scope Use
79
-
80
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
81
-
82
- [More Information Needed]
83
-
84
- ## Bias, Risks, and Limitations
85
-
86
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
87
-
88
- [More Information Needed]
89
-
90
- ### Recommendations
91
-
92
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
93
-
94
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
95
-
96
- ## How to Get Started with the Model
97
-
98
- Use the code below to get started with the model.
99
-
100
- [More Information Needed]
101
-
102
- ## Training Details
103
-
104
- ### Training Data
105
-
106
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
107
-
108
- [More Information Needed]
109
-
110
- ### Training Procedure
111
-
112
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
113
-
114
- #### Preprocessing [optional]
115
-
116
- [More Information Needed]
117
-
118
- #### Training Hyperparameters
119
-
120
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
121
-
122
- #### Speeds, Sizes, Times [optional]
123
-
124
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
125
-
126
- [More Information Needed]
127
-
128
- ## Evaluation
129
-
130
- <!-- This section describes the evaluation protocols and provides the results. -->
131
-
132
- ### Testing Data, Factors & Metrics
133
-
134
- #### Testing Data
135
-
136
- <!-- This should link to a Dataset Card if possible. -->
137
-
138
- [More Information Needed]
139
-
140
- #### Factors
141
 
142
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
 
 
143
 
144
- [More Information Needed]
145
 
146
- #### Metrics
147
 
148
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
149
-
150
- [More Information Needed]
151
-
152
- ### Results
153
-
154
- [More Information Needed]
155
-
156
- #### Summary
157
-
158
- ## Model Examination [optional]
159
-
160
- <!-- Relevant interpretability work for the model goes here -->
161
-
162
- [More Information Needed]
163
-
164
- ## Environmental Impact
165
-
166
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
167
-
168
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
169
-
170
- - **Hardware Type:** [More Information Needed]
171
- - **Hours used:** [More Information Needed]
172
- - **Cloud Provider:** [More Information Needed]
173
- - **Compute Region:** [More Information Needed]
174
- - **Carbon Emitted:** [More Information Needed]
175
-
176
- ## Technical Specifications [optional]
177
-
178
- ### Model Architecture and Objective
179
-
180
- [More Information Needed]
181
-
182
- ### Compute Infrastructure
183
-
184
- [More Information Needed]
185
-
186
- #### Hardware
187
-
188
- [More Information Needed]
189
-
190
- #### Software
191
-
192
- [More Information Needed]
193
-
194
- ## Citation [optional]
195
-
196
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
197
-
198
- **BibTeX:**
199
-
200
- [More Information Needed]
201
-
202
- **APA:**
203
-
204
- [More Information Needed]
205
-
206
- ## Glossary [optional]
207
-
208
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
209
-
210
- [More Information Needed]
211
-
212
- ## More Information [optional]
213
-
214
- [More Information Needed]
215
-
216
- ## Model Card Authors [optional]
217
-
218
- [More Information Needed]
219
-
220
- ## Model Card Contact
221
-
222
- [More Information Needed]
223
-
224
- ### Framework versions
225
-
226
- - PEFT 0.16.0
227
-
228
- ## Usage
229
 
230
- ### Using with Transformers
231
 
232
  ```python
233
- from transformers import AutoTokenizer, AutoModelForCausalLM
234
- from peft import PeftModel
235
  import torch
 
236
 
237
- # Load the base model
238
- base_model = AutoModelForCausalLM.from_pretrained(
239
- "Qwen/Qwen2.5-3B",
 
240
  torch_dtype=torch.bfloat16,
241
- device_map="auto"
242
  )
243
 
244
- # Load the tokenizer
245
- tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B")
 
 
246
 
247
- # Load the LoRA adapter
248
- model = PeftModel.from_pretrained(base_model, "your-username/trek-nepal-3b")
249
-
250
- # Generate text
251
- prompt = "What permits do I need for Everest Base Camp trek?"
252
- inputs = tokenizer(prompt, return_tensors="pt")
253
- outputs = model.generate(**inputs, max_length=200, temperature=0.7)
254
- response = tokenizer.decode(outputs[0], skip_special_tokens=True)
255
- print(response)
256
  ```
257
 
258
- ### Chat Template
259
 
260
- The model uses the Qwen2.5 chat template format:
261
 
262
- ```
263
- <|im_start|>system
264
- You are a helpful assistant specialized in providing information about trekking in Nepal.
265
- <|im_end|>
266
- <|im_start|>user
267
- {user_message}
268
- <|im_end|>
269
- <|im_start|>assistant
270
- ```
271
 
272
- ## Training Details
273
 
274
- - **Training Method**: Supervised Fine-Tuning (SFT) with LoRA
275
- - **Dataset**: Custom Nepal trekking Q&A dataset
276
- - **Optimization**: 4-bit quantization with bfloat16
277
- - **GPU**: Optimized for L40S GPU training
278
- - **Batch Size**: 16 with gradient accumulation steps of 2
279
 
280
- ## Intended Use
 
 
 
 
281
 
282
- This model is specifically designed for:
283
 
284
- - Nepal trekking route information
285
- - Permit requirements and procedures
286
- - Gear and equipment recommendations
287
- - Weather and seasonal advice
288
- - Safety guidelines and preparations
289
- - Accommodation and logistics
290
- - Cost estimation and budgeting
291
 
292
  ## Limitations
293
 
294
- - Specialized only for Nepal trekking topics
295
- - May not perform well on general conversation topics
296
- - Information is based on training data and should be verified with official sources
297
- - Always consult local authorities and guides for current conditions
298
 
299
  ## License
300
 
301
- This model is licensed under Apache 2.0.
302
-
303
- ## Training Configuration
304
 
305
- The model was trained using the following LoRA configuration:
306
 
307
- - **r**: 128
308
- - **lora_alpha**: 256
309
- - **lora_dropout**: 0.05
310
- - **target_modules**: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
311
- - **bias**: "none"
312
- - **task_type**: "CAUSAL_LM"
 
1
  ---
2
+ title: Trek-Nepal-3B
3
  emoji: 🏔️
4
  colorFrom: blue
5
  colorTo: green
 
29
 
30
  # Trek Nepal 3B - Fine-tuned Llama-3.2-3B for Nepal Trekking
31
 
32
+ Trek Nepal 3B is a specialized fine-tuned version of [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct) that focuses exclusively on Nepal trekking information. The model was trained on a comprehensive dataset of mountaineering books, trekker guides, and web-scraped content with approximately 3.8k examples, including 300 negative examples for better response quality.
33
 
34
+ **Developed by:** Ashok BK (blazewild)
35
 
36
+ ## Links
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ - 🤗 **Hugging Face**: https://huggingface.co/blazewild/trek-nepal
39
+ - 🦙 **Ollama**: https://ollama.com/blazewild/trek-nepal
40
+ - 📝 **Medium Blog**: [Coming Soon]
41
 
42
+ ## Quick Start
43
 
44
+ ### Ollama (Recommended)
45
 
46
+ ```bash
47
+ ollama run blazewild/trek-nepal
48
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
+ ### Transformers
51
 
52
  ```python
 
 
53
  import torch
54
+ from transformers import pipeline
55
 
56
+ model_id = "blazewild/trek-nepal"
57
+ pipe = pipeline(
58
+ "text-generation",
59
+ model=model_id,
60
  torch_dtype=torch.bfloat16,
61
+ device_map="auto",
62
  )
63
 
64
+ messages = [
65
+ {"role": "system", "content": "You are Trek Nepal, a friendly and knowledgeable Nepal trekking expert assistant. You specialize in providing information about trekking in Nepal.\n\nYou can respond to greetings, have casual conversations, and be helpful and personable. When it comes to providing information, you focus exclusively on Nepal trekking topics in detail.\n\nFor Nepal trekking questions, provide detailed, comprehensive answers with everything you know about the topic. Use natural formatting with headings, bullet points, and proper structure in markdown format. Write in a conversational yet informative style, adapting very detail level based on the complexity of the question.\n\nFor questions completely unrelated to Nepal trekking, politely redirect: \"I'm sorry, I specialize in Nepal trekking information. Is there anything about trekking in Nepal I can help you with?\"\n\nBe natural, thorough, and conversational while maintaining your expertise in Nepal trekking."},
66
+ {"role": "user", "content": "What permits do I need for Everest Base Camp trek?"},
67
+ ]
68
 
69
+ outputs = pipe(
70
+ messages,
71
+ max_new_tokens=256,
72
+ )
73
+ print(outputs[0]["generated_text"][-1])
 
 
 
 
74
  ```
75
 
76
+ ## What it does
77
 
78
+ This model specializes in providing expert guidance on Nepal trekking topics:
79
 
80
+ - **Trekking Routes**: Detailed information about popular routes like Everest Base Camp, Annapurna Circuit, Langtang Valley, etc.
81
+ - **Permits & Logistics**: Requirements, procedures, and costs for trekking permits
82
+ - **Gear & Equipment**: Recommendations for different seasons and routes
83
+ - **Weather & Safety**: Seasonal advice, safety protocols, and preparation tips
84
+ - **Accommodation & Planning**: Logistics, costs, and itinerary planning
 
 
 
 
85
 
86
+ For questions outside Nepal trekking, it politely redirects users back to its area of expertise.
87
 
88
+ ## Training Details
 
 
 
 
89
 
90
+ - **Base Model**: meta-llama/Llama-3.2-3B-Instruct
91
+ - **Fine-tuning**: LoRA (Low-Rank Adaptation)
92
+ - **Dataset**: ~3.8k examples from mountaineering books, trekker guides, and web scrapes
93
+ - **Negative Examples**: 300 examples for better refusal behavior
94
+ - **Training Time**: 1 hour on 1x L40S GPU
95
 
96
+ ### LoRA Configuration
97
 
98
+ - **Rank**: 128
99
+ - **Alpha**: 256
100
+ - **Dropout**: 0.05
101
+ - **Epochs**: 10
102
+ - **Batch Size**: 128
 
 
103
 
104
  ## Limitations
105
 
106
+ - **Domain-Specific**: Only provides information about Nepal trekking
107
+ - **Information Currency**: Based on training data; always verify current conditions
108
+ - **Safety Critical**: Always consult local authorities and guides for current trail conditions
109
+ - **Not Medical Advice**: Consult healthcare professionals for medical concerns
110
 
111
  ## License
112
 
113
+ Apache 2.0
 
 
114
 
115
+ ---
116
 
117
+ _For questions or issues, please contact through the Hugging Face model repository._