Spaces:
Running
Running
Refactor settings.py: Update Llama 7B model configuration to TinyLlama 1.1B and replace OpenChat 3.5 with Microsoft Phi-2, enhancing performance details and documentation
Browse files- config/settings.py +23 -66
config/settings.py
CHANGED
|
@@ -127,7 +127,7 @@ MODELS = {
|
|
| 127 |
"documentation": "https://huggingface.co/HuggingFaceH4/zephyr-7b-beta"
|
| 128 |
}
|
| 129 |
},
|
| 130 |
-
"llama-7b": {
|
| 131 |
"id": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
| 132 |
"name": "TinyLlama 1.1B Chat",
|
| 133 |
"description": "Lightweight chat model with excellent performance for its size",
|
|
@@ -174,50 +174,6 @@ MODELS = {
|
|
| 174 |
"documentation": "https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0"
|
| 175 |
}
|
| 176 |
},
|
| 177 |
-
"mistral-7b": {
|
| 178 |
-
"id": "mistralai/Mistral-7B-Instruct-v0.2", # Меняем на стандартную версию
|
| 179 |
-
"name": "Mistral 7B Instruct",
|
| 180 |
-
"description": "High-performance instruction-tuned 7B model with strong multilingual capabilities",
|
| 181 |
-
"type": "base",
|
| 182 |
-
"parameters": {
|
| 183 |
-
"max_length": 2048,
|
| 184 |
-
"temperature": 0.7,
|
| 185 |
-
"top_p": 0.9,
|
| 186 |
-
"repetition_penalty": 1.1,
|
| 187 |
-
},
|
| 188 |
-
"training": {
|
| 189 |
-
"base_model_path": "mistralai/Mistral-7B-Instruct-v0.2",
|
| 190 |
-
"fine_tuned_path": os.path.join(TRAINING_OUTPUT_DIR, "mistral-7b-instruct-tuned"),
|
| 191 |
-
"lora_config": {
|
| 192 |
-
"r": 16,
|
| 193 |
-
"lora_alpha": 32,
|
| 194 |
-
"lora_dropout": 0.05,
|
| 195 |
-
"target_modules": ["q_proj", "v_proj", "k_proj", "o_proj"]
|
| 196 |
-
}
|
| 197 |
-
},
|
| 198 |
-
"details": {
|
| 199 |
-
"full_name": "Mistral 7B Instruct v0.2",
|
| 200 |
-
"capabilities": [
|
| 201 |
-
"Strong multilingual support",
|
| 202 |
-
"Excellent instruction following",
|
| 203 |
-
"Advanced reasoning capabilities",
|
| 204 |
-
"High-quality text generation",
|
| 205 |
-
"Free for commercial use"
|
| 206 |
-
],
|
| 207 |
-
"limitations": [
|
| 208 |
-
"Requires more RAM than GGUF version",
|
| 209 |
-
"May need GPU for optimal performance",
|
| 210 |
-
"Knowledge cutoff before latest developments"
|
| 211 |
-
],
|
| 212 |
-
"use_cases": [
|
| 213 |
-
"Complex legal analysis",
|
| 214 |
-
"Multilingual consultation",
|
| 215 |
-
"Document processing",
|
| 216 |
-
"General assistance"
|
| 217 |
-
],
|
| 218 |
-
"documentation": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2"
|
| 219 |
-
}
|
| 220 |
-
},
|
| 221 |
"mixtral-8x7b": {
|
| 222 |
"id": "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 223 |
"name": "Mixtral 8x7B Instruct",
|
|
@@ -261,20 +217,20 @@ MODELS = {
|
|
| 261 |
"documentation": "https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 262 |
}
|
| 263 |
},
|
| 264 |
-
"
|
| 265 |
-
"id": "
|
| 266 |
-
"name": "
|
| 267 |
-
"description": "
|
| 268 |
"type": "base",
|
| 269 |
"parameters": {
|
| 270 |
-
"max_length":
|
| 271 |
"temperature": 0.7,
|
| 272 |
"top_p": 0.9,
|
| 273 |
"repetition_penalty": 1.1,
|
| 274 |
},
|
| 275 |
"training": {
|
| 276 |
-
"base_model_path": "
|
| 277 |
-
"fine_tuned_path": os.path.join(TRAINING_OUTPUT_DIR, "
|
| 278 |
"lora_config": {
|
| 279 |
"r": 16,
|
| 280 |
"lora_alpha": 32,
|
|
@@ -283,29 +239,30 @@ MODELS = {
|
|
| 283 |
}
|
| 284 |
},
|
| 285 |
"details": {
|
| 286 |
-
"full_name": "
|
| 287 |
"capabilities": [
|
| 288 |
-
"Strong
|
| 289 |
-
"Excellent
|
| 290 |
-
"
|
| 291 |
-
"
|
| 292 |
-
"
|
|
|
|
| 293 |
],
|
| 294 |
"limitations": [
|
| 295 |
-
"
|
| 296 |
"Less specialized in legal domain",
|
| 297 |
-
"
|
| 298 |
],
|
| 299 |
"use_cases": [
|
| 300 |
-
"
|
| 301 |
"Document analysis",
|
| 302 |
-
"
|
| 303 |
-
"
|
| 304 |
],
|
| 305 |
-
"documentation": "https://huggingface.co/
|
| 306 |
}
|
| 307 |
-
}
|
| 308 |
-
|
| 309 |
|
| 310 |
# Update MODELS configuration
|
| 311 |
for model in MODELS.values():
|
|
|
|
| 127 |
"documentation": "https://huggingface.co/HuggingFaceH4/zephyr-7b-beta"
|
| 128 |
}
|
| 129 |
},
|
| 130 |
+
"llama-7b": {
|
| 131 |
"id": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
| 132 |
"name": "TinyLlama 1.1B Chat",
|
| 133 |
"description": "Lightweight chat model with excellent performance for its size",
|
|
|
|
| 174 |
"documentation": "https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0"
|
| 175 |
}
|
| 176 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
"mixtral-8x7b": {
|
| 178 |
"id": "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 179 |
"name": "Mixtral 8x7B Instruct",
|
|
|
|
| 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,
|
| 227 |
"temperature": 0.7,
|
| 228 |
"top_p": 0.9,
|
| 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 |
}
|
| 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 |
+
}
|
| 266 |
|
| 267 |
# Update MODELS configuration
|
| 268 |
for model in MODELS.values():
|