Rulga commited on
Commit
e6ceacc
·
1 Parent(s): 3a0af00

Refactor settings.py: Replace Phi-2 model configuration with Neural Mistral 7B, enhancing reasoning and instruction following capabilities

Browse files
Files changed (2) hide show
  1. README.md +7 -7
  2. config/settings.py +22 -21
README.md CHANGED
@@ -40,10 +40,10 @@ Status Law Assistant is a smart chatbot that answers user questions about Status
40
  - Model switching system with automatic fallback
41
  - Fine-tuning capabilities based on chat history
42
  - Multiple model support:
43
- - Llama 2 7B Chat (primary): Optimized for dialogues
44
  - Zephyr 7B: Enhanced performance and response quality
45
- - Mistral 7B Instruct v0.2: Superior multilingual capabilities
46
- - XGLM 7.5B: Specialized cross-lingual generation model (requires paid API access)
 
47
 
48
  ## 🚀 Technologies
49
 
@@ -135,17 +135,17 @@ The fine-tuning process uses LoRA (Low-Rank Adaptation) for efficient training w
135
 
136
  The application supports multiple models with automatic fallback:
137
 
138
- - Llama 2 7B Chat (default): Optimized for dialogues
139
  - Zephyr 7B: Enhanced performance and response quality
140
- - Mistral 7B Instruct v0.2: Superior multilingual capabilities
141
- - XGLM 7.5B: Specialized cross-lingual generation model (requires paid API access)
 
142
 
143
  Models can be switched dynamically through the interface or programmatically:
144
 
145
  ```python
146
  from src.training.model_manager import switch_to_model
147
 
148
- switch_to_model("llama-7b") # or "zephyr-7b", "mistral-7b", "xglm-7b"
149
  ```
150
 
151
  ## 🔄 Knowledge Base Management
 
40
  - Model switching system with automatic fallback
41
  - Fine-tuning capabilities based on chat history
42
  - Multiple model support:
 
43
  - Zephyr 7B: Enhanced performance and response quality
44
+ - TinyLlama 1.1B Chat: Lightweight model for resource-constrained environments
45
+ - Neural Mistral 7B: Superior reasoning and instruction following capabilities
46
+ - Mixtral 8x7B: Advanced mixture-of-experts architecture
47
 
48
  ## 🚀 Technologies
49
 
 
135
 
136
  The application supports multiple models with automatic fallback:
137
 
 
138
  - Zephyr 7B: Enhanced performance and response quality
139
+ - TinyLlama 1.1B Chat: Lightweight model for resource-constrained environments
140
+ - Neural Mistral 7B: Superior reasoning and instruction following capabilities
141
+ - Mixtral 8x7B: Advanced mixture-of-experts architecture
142
 
143
  Models can be switched dynamically through the interface or programmatically:
144
 
145
  ```python
146
  from src.training.model_manager import switch_to_model
147
 
148
+ switch_to_model("zephyr-7b") # or "tinyllama-1.1b", "neural-mistral-7b", "mixtral-8x7b"
149
  ```
150
 
151
  ## 🔄 Knowledge Base Management
config/settings.py CHANGED
@@ -217,10 +217,10 @@ MODELS = {
217
  "documentation": "https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1"
218
  }
219
  },
220
- "phi-2": {
221
- "id": "microsoft/phi-2",
222
- "name": "Phi-2",
223
- "description": "Compact yet powerful 2.7B model with strong reasoning capabilities",
224
  "type": "base",
225
  "parameters": {
226
  "max_length": 2048,
@@ -229,8 +229,8 @@ MODELS = {
229
  "repetition_penalty": 1.1,
230
  },
231
  "training": {
232
- "base_model_path": "microsoft/phi-2",
233
- "fine_tuned_path": os.path.join(TRAINING_OUTPUT_DIR, "phi-2-tuned"),
234
  "lora_config": {
235
  "r": 16,
236
  "lora_alpha": 32,
@@ -239,27 +239,28 @@ MODELS = {
239
  }
240
  },
241
  "details": {
242
- "full_name": "Microsoft Phi-2",
243
  "capabilities": [
244
- "Strong reasoning abilities",
245
- "Excellent code understanding",
246
- "Compact size (2.7B parameters)",
247
- "Good performance-to-size ratio",
248
- "Efficient resource usage",
249
- "Research and commercial use allowed"
250
  ],
251
  "limitations": [
252
- "Smaller context window than larger models",
253
- "Less specialized in legal domain",
254
- "Limited multilingual capabilities"
255
  ],
256
  "use_cases": [
257
- "Quick legal consultations",
258
- "Document analysis",
259
- "Code-related legal questions",
260
- "Resource-efficient deployments"
 
261
  ],
262
- "documentation": "https://huggingface.co/microsoft/phi-2"
263
  }
264
  }
265
  }
 
217
  "documentation": "https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1"
218
  }
219
  },
220
+ "neural-mistral": { # заменяем phi-2
221
+ "id": "teknium/Neural-Mistral-7B-v0.1",
222
+ "name": "Neural Mistral 7B",
223
+ "description": "Enhanced version of Mistral with improved reasoning and instruction following",
224
  "type": "base",
225
  "parameters": {
226
  "max_length": 2048,
 
229
  "repetition_penalty": 1.1,
230
  },
231
  "training": {
232
+ "base_model_path": "teknium/Neural-Mistral-7B-v0.1",
233
+ "fine_tuned_path": os.path.join(TRAINING_OUTPUT_DIR, "neural-mistral-7b-tuned"),
234
  "lora_config": {
235
  "r": 16,
236
  "lora_alpha": 32,
 
239
  }
240
  },
241
  "details": {
242
+ "full_name": "Neural Mistral 7B v0.1",
243
  "capabilities": [
244
+ "Enhanced reasoning capabilities",
245
+ "Improved instruction following",
246
+ "Strong multilingual support",
247
+ "Better context understanding",
248
+ "Advanced problem-solving abilities",
249
+ "Consistent output quality"
250
  ],
251
  "limitations": [
252
+ "Requires more GPU memory",
253
+ "May be slower than smaller models",
254
+ "Resource intensive for fine-tuning"
255
  ],
256
  "use_cases": [
257
+ "Complex legal analysis",
258
+ "Advanced reasoning tasks",
259
+ "Detailed document processing",
260
+ "Professional consultation",
261
+ "Research assistance"
262
  ],
263
+ "documentation": "https://huggingface.co/teknium/Neural-Mistral-7B-v0.1"
264
  }
265
  }
266
  }