Spaces:
Running
Running
Refactor settings.py: Replace Phi-2 model configuration with Neural Mistral 7B, enhancing reasoning and instruction following capabilities
Browse files- README.md +7 -7
- 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 |
-
-
|
| 46 |
-
-
|
|
|
|
| 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 |
-
-
|
| 141 |
-
-
|
|
|
|
| 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("
|
| 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 |
-
"
|
| 221 |
-
"id": "
|
| 222 |
-
"name": "
|
| 223 |
-
"description": "
|
| 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": "
|
| 233 |
-
"fine_tuned_path": os.path.join(TRAINING_OUTPUT_DIR, "
|
| 234 |
"lora_config": {
|
| 235 |
"r": 16,
|
| 236 |
"lora_alpha": 32,
|
|
@@ -239,27 +239,28 @@ MODELS = {
|
|
| 239 |
}
|
| 240 |
},
|
| 241 |
"details": {
|
| 242 |
-
"full_name": "
|
| 243 |
"capabilities": [
|
| 244 |
-
"
|
| 245 |
-
"
|
| 246 |
-
"
|
| 247 |
-
"
|
| 248 |
-
"
|
| 249 |
-
"
|
| 250 |
],
|
| 251 |
"limitations": [
|
| 252 |
-
"
|
| 253 |
-
"
|
| 254 |
-
"
|
| 255 |
],
|
| 256 |
"use_cases": [
|
| 257 |
-
"
|
| 258 |
-
"
|
| 259 |
-
"
|
| 260 |
-
"
|
|
|
|
| 261 |
],
|
| 262 |
-
"documentation": "https://huggingface.co/
|
| 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 |
}
|