millat commited on
Commit
30ca654
Β·
verified Β·
1 Parent(s): e6fc405

Add comprehensive README with all formats and quantizations

Browse files
Files changed (1) hide show
  1. README.md +116 -137
README.md CHANGED
@@ -1,11 +1,17 @@
1
  ---
2
- base_model: unsloth/mistral-7b-instruct-v0.3-bnb-4bit
3
- library_name: peft
 
 
 
 
 
 
 
4
  license: mit
 
5
  datasets:
6
  - millat/StudyAbroadGPT-Dataset
7
- language:
8
- - en
9
  ---
10
 
11
  # StudyAbroadGPT-7B-LoRa: Specialized Educational Guidance Model
@@ -14,138 +20,133 @@ language:
14
 
15
  StudyAbroadGPT-7B-LoRa is a specialized language model fine-tuned for providing comprehensive study abroad consultation and educational guidance. Based on the Mistral-7B model, it utilizes parameter-efficient fine-tuning through Low-Rank Adaptation (LoRA) to deliver accurate, personalized guidance for students seeking higher education opportunities abroad.
16
 
17
- ## Key Features
18
-
19
- - 🎯 **Specialized Domain**: Focused on international education consulting
20
- - πŸ”§ **Efficient Architecture**: 4-bit quantized with LoRA adaptation
21
- - πŸ“š **Comprehensive Coverage**: University selection, applications, housing, funding, visas
22
- - ⚑ **Resource Efficient**: Optimized for deployment in resource-constrained environments
23
-
24
- ## Technical Specifications
25
-
26
- - **Base Model**: unsloth/mistral-7b-instruct-v0.3-bnb-4bit
27
- - **Architecture**:
28
- - 4-bit quantization (GPTQ)
29
- - Context Length: 2048 tokens
30
- - Memory Footprint: ~8GB
31
- - **LoRA Configuration**:
32
- - Rank (r): 16
33
- - Alpha: 32
34
- - Target Modules:
35
- * Attention layers (q_proj, k_proj, v_proj, o_proj)
36
- * FFN layers (gate_proj, up_proj, down_proj)
37
-
38
- ## Training
39
-
40
- ### Dataset
41
- - Total Conversations: 2,676
42
- - Training: 2,274 (85%)
43
- - Testing: 402 (15%)
44
- - Average turns per conversation: 5.2
45
- - Query length: 5-50 words
46
- - Response length: 100-300 words
47
-
48
- ### Training Process
49
- 1. **Phase 1 (P100 GPU)**:
50
- - Initial fine-tuning
51
- - Steps: 284
52
- - Learning rate: 2e-4
53
- - Starting loss: 1.0125
54
- - Final loss: 0.4787
55
-
56
- 2. **Phase 2 (T4 GPU)**:
57
- - Extended training
58
- - 2 additional epochs
59
- - Steps per epoch: 142
60
- - Learning rate: 1e-4
61
-
62
- ## Performance Metrics
63
-
64
- - **Accuracy**:
65
- - Content accuracy: 92%
66
- - Format consistency: 95%
67
- - Action steps clarity: 85%
68
- - Topic coverage: 88%
69
- - Context coherence: 91%
70
-
71
- - **Response Quality**:
72
- - Markdown formatting: 95%
73
- - Information completeness: 90%
74
- - Response length: 100-300 words
75
-
76
- ## Use Cases
77
-
78
- This model is designed for:
79
- - University selection and application guidance
80
- - Scholarship and funding advice
81
- - Visa requirements consultation
82
- - Housing and accommodation guidance
83
- - Academic program recommendations
84
- - Research opportunity exploration
85
-
86
- ## Example Usage
87
 
88
  ```python
89
  from transformers import AutoModelForCausalLM, AutoTokenizer
90
  import torch
91
 
92
- # Load model and tokenizer
93
  model = AutoModelForCausalLM.from_pretrained(
94
  "millat/StudyAbroadGPT-7B-LoRa-Kaggle",
 
95
  torch_dtype=torch.float16,
96
- load_in_4bit=True
97
- )
98
- tokenizer = AutoTokenizer.from_pretrained("millat/StudyAbroadGPT-7B-LoRa-Kaggle")
99
-
100
- # Example query
101
- query = """I'm interested in pursuing a Master's in Computer Science in the USA.
102
- My GPA is 3.5/4.0 and I have a TOEFL score of 100. What universities should I consider?"""
103
-
104
- # Generate response
105
- inputs = tokenizer(query, return_tensors="pt").to(model.device)
106
- outputs = model.generate(
107
- **inputs,
108
- max_length=1024,
109
- temperature=0.7,
110
- top_p=0.9
111
  )
 
 
 
 
 
 
112
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
113
  print(response)
114
  ```
115
 
116
- ## Limitations
117
 
118
- 1. **Knowledge Cutoff**:
119
- - Limited to training data timeframe
120
- - May not reflect recent changes in admission policies
121
- - University-specific details may need verification
122
 
123
- 2. **Response Scope**:
124
- - Focuses on general guidance rather than institution-specific details
125
- - May not cover highly specialized programs
126
- - Regional variations in admission standards may not be fully captured
 
127
 
128
- 3. **Technical Requirements**:
129
- - Minimum 8GB GPU memory for inference
130
- - Optimal performance requires 16GB+ system memory
131
- - 4-bit quantization may impact response precision
132
 
133
- ## Recommendations
134
 
135
- 1. **Best Practices**:
136
- - Provide clear, specific queries
137
- - Include relevant academic credentials
138
- - Specify geographical preferences
139
- - Mention budget constraints if applicable
140
 
141
- 2. **Verification**:
142
- - Cross-verify university-specific information
143
- - Check latest admission requirements
144
- - Confirm financial requirements independently
 
 
 
 
145
 
146
  ## Citation
147
 
148
- If you use this model in your research, please cite:
149
 
150
  ```bibtex
151
  @misc{millat2025studyabroadgpt,
@@ -157,28 +158,6 @@ If you use this model in your research, please cite:
157
  }
158
  ```
159
 
160
- And optionally the associated paper:
161
-
162
- ```bibtex
163
- @article{hosen2025lora,
164
- title={A LoRA-Based Approach to Fine-Tuning LLMs for Educational Guidance in Resource-Constrained Settings},
165
- author={Hosen, Md Millat},
166
- journal={arXiv preprint arXiv:2504.15610},
167
- year={2025}
168
- }
169
- ```
170
-
171
- ---
172
-
173
- ## πŸ”— Relevant Links
174
-
175
- * πŸ” [Model](https://huggingface.co/millat/StudyAbroadGPT-7B-LoRa-Kaggle)
176
- * πŸ’Ύ [Training Code](https://github.com/codermillat/StudyAbroadGPT)
177
- * 🧠 [Author ORCID](https://orcid.org/0009-0005-7198-9893)
178
- * πŸ“„ [Research paper (preprint)](https://arxiv.org/abs/2504.15610) β€” DOI: [10.48550/arXiv.2504.15610](https://doi.org/10.48550/arXiv.2504.15610)
179
- * πŸ’» [Training code](https://github.com/codermillat/StudyAbroadGPT)
180
-
181
-
182
  ## License
183
 
184
- This model is released under the same license as the base Mistral-7B model. Please refer to the license terms of the original model for usage conditions.
 
1
  ---
2
+ library_name: transformers
3
+ tags:
4
+ - study-abroad
5
+ - education
6
+ - guidance
7
+ - mistral
8
+ - lora
9
+ - gguf
10
+ - onnx
11
  license: mit
12
+ base_model: mistralai/Mistral-7B-Instruct-v0.3
13
  datasets:
14
  - millat/StudyAbroadGPT-Dataset
 
 
15
  ---
16
 
17
  # StudyAbroadGPT-7B-LoRa: Specialized Educational Guidance Model
 
20
 
21
  StudyAbroadGPT-7B-LoRa is a specialized language model fine-tuned for providing comprehensive study abroad consultation and educational guidance. Based on the Mistral-7B model, it utilizes parameter-efficient fine-tuning through Low-Rank Adaptation (LoRA) to deliver accurate, personalized guidance for students seeking higher education opportunities abroad.
22
 
23
+ ## Available Formats
24
+
25
+ This repository contains the model in multiple formats and quantizations for different use cases:
26
+
27
+ ### PyTorch Formats
28
+ - **Merged Model** (`merged/`): Full precision PyTorch model with merged LoRA weights (~14GB)
29
+
30
+ ### GGUF Formats
31
+
32
+ GGUF files are available in the root directory. Choose the quantization level based on your hardware and quality requirements:
33
+
34
+
35
+ #### 2-BIT
36
+
37
+ - **Q2_K**: [studyabroadgpt-q2_k.gguf](studyabroadgpt-q2_k.gguf) - 2.72 GB βœ…
38
+
39
+ #### 3-BIT
40
+
41
+ - **Q3_K_S**: [studyabroadgpt-q3_k_s.gguf](studyabroadgpt-q3_k_s.gguf) - 3.16 GB βœ…
42
+ - **Q3_K_M**: [studyabroadgpt-q3_k_m.gguf](studyabroadgpt-q3_k_m.gguf) - 3.52 GB βœ…
43
+ - **Q3_K_L**: [studyabroadgpt-q3_k_l.gguf](studyabroadgpt-q3_k_l.gguf) - 3.82 GB βœ…
44
+
45
+ #### 4-BIT
46
+
47
+ - **Q4_0**: [studyabroadgpt-q4_0.gguf](studyabroadgpt-q4_0.gguf) - 4.00 GB βœ…
48
+ - **Q4_K_S**: [studyabroadgpt-q4_k_s.gguf](studyabroadgpt-q4_k_s.gguf) - 4.14 GB βœ…
49
+ - **Q4_K_M**: [studyabroadgpt-q4_k_m.gguf](studyabroadgpt-q4_k_m.gguf) - 4.37 GB βœ…
50
+
51
+ #### 5-BIT
52
+
53
+ - **Q5_K_S**: [studyabroadgpt-q5_k_s.gguf](studyabroadgpt-q5_k_s.gguf) - 5.00 GB βœ…
54
+ - **Q5_K_M**: [studyabroadgpt-q5_k_m.gguf](studyabroadgpt-q5_k_m.gguf) - 5.13 GB βœ…
55
+
56
+ #### 6-BIT
57
+
58
+ - **Q6_K**: [studyabroadgpt-q6_k.gguf](studyabroadgpt-q6_k.gguf) - 5.94 GB βœ…
59
+
60
+ #### 8-BIT
61
+
62
+ - **Q8_0**: [studyabroadgpt-q8_0.gguf](studyabroadgpt-q8_0.gguf) - 7.70 GB βœ…
63
+
64
+ #### 16-bit
65
+ - **F16**: [studyabroadgpt-f16.gguf](studyabroadgpt-f16.gguf) - ~14.5 GB βœ…
66
+
67
+ ### ONNX Formats
68
+ - **ONNX FP16** (`onnx/`): Cross-platform inference format (~14GB)
69
+ - **ONNX INT8** (`onnx_int8/`): Quantized version for mobile/edge devices (~7GB)
70
+
71
+ ## Hardware Compatibility
72
+
73
+ - **Apple M1 (8 GB)**: Q2_K, Q3_K_S, Q3_K_M, Q4_K_S recommended
74
+ - **Apple M1 (16 GB)**: Q4_K_M, Q5_K_S, Q5_K_M, Q6_K recommended
75
+ - **Desktop/Laptop (8 GB RAM)**: Q4_K_S, Q4_K_M recommended
76
+ - **Desktop/Laptop (16+ GB RAM)**: Q5_K_M, Q6_K, Q8_0, F16 recommended
77
+
78
+ ## Usage
79
+
80
+ ### GGUF Format
81
+
82
+ For GGUF files, use with [llama.cpp](https://github.com/ggerganov/llama.cpp) or compatible tools:
83
+
84
+ ```bash
85
+ # Download the desired quantization
86
+ wget https://huggingface.co/millat/StudyAbroadGPT-7B-LoRa-Kaggle/resolve/main/studyabroadgpt-q4_k_m.gguf
87
+
88
+ # Run with llama.cpp
89
+ ./main -m studyabroadgpt-q4_k_m.gguf -p "Your prompt here"
90
+ ```
91
+
92
+ ### PyTorch Format
93
 
94
  ```python
95
  from transformers import AutoModelForCausalLM, AutoTokenizer
96
  import torch
97
 
 
98
  model = AutoModelForCausalLM.from_pretrained(
99
  "millat/StudyAbroadGPT-7B-LoRa-Kaggle",
100
+ subfolder="merged",
101
  torch_dtype=torch.float16,
102
+ device_map="auto"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  )
104
+ tokenizer = AutoTokenizer.from_pretrained("millat/StudyAbroadGPT-7B-LoRa-Kaggle", subfolder="merged")
105
+
106
+ # Generate
107
+ prompt = "I'm interested in pursuing a Master's in Computer Science in the USA..."
108
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
109
+ outputs = model.generate(**inputs, max_length=512, temperature=0.7)
110
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
111
  print(response)
112
  ```
113
 
114
+ ### ONNX Format
115
 
116
+ ```python
117
+ from optimum.onnxruntime import ORTModelForCausalLM
118
+ from transformers import AutoTokenizer
 
119
 
120
+ model = ORTModelForCausalLM.from_pretrained(
121
+ "millat/StudyAbroadGPT-7B-LoRa-Kaggle",
122
+ subfolder="onnx"
123
+ )
124
+ tokenizer = AutoTokenizer.from_pretrained("millat/StudyAbroadGPT-7B-LoRa-Kaggle", subfolder="onnx")
125
 
126
+ inputs = tokenizer("Your prompt", return_tensors="pt")
127
+ outputs = model.generate(**inputs, max_length=512)
128
+ response = tokenizer.decode(outputs[0], skip_special_tokens=True)
129
+ ```
130
 
131
+ ## Quantization Notes
132
 
133
+ - **IQ-quants** (if available) are often preferable over similar-sized non-IQ quants
134
+ - **Lower bit quantizations** (Q2_K, Q3_K) are smaller but may have quality trade-offs
135
+ - **Higher bit quantizations** (Q6_K, Q8_0) provide better quality at larger file sizes
136
+ - **F16** provides the best quality but requires significant storage and memory
 
137
 
138
+ ## Model Information
139
+
140
+ - **Base Model**: mistralai/Mistral-7B-Instruct-v0.3
141
+ - **Architecture**: Mistral-7B with LoRA adaptation
142
+ - **LoRA Rank**: 16
143
+ - **LoRA Alpha**: 32
144
+ - **Context Length**: 2048 tokens
145
+ - **Training Dataset**: [millat/StudyAbroadGPT-Dataset](https://huggingface.co/datasets/millat/StudyAbroadGPT-Dataset)
146
 
147
  ## Citation
148
 
149
+ If you use this model, please cite:
150
 
151
  ```bibtex
152
  @misc{millat2025studyabroadgpt,
 
158
  }
159
  ```
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  ## License
162
 
163
+ This model is released under the MIT license.