Upload train_aviation.py with huggingface_hub
Browse files- train_aviation.py +8 -6
train_aviation.py
CHANGED
|
@@ -42,17 +42,18 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
|
| 42 |
# Register 'ministral3' config to handle nested text_config
|
| 43 |
print("🔧 Registering ministral3 config...")
|
| 44 |
try:
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 47 |
model_type = "ministral3"
|
| 48 |
|
| 49 |
# 1. Register Config
|
| 50 |
AutoConfig.register("ministral3", Ministral3CompatConfig)
|
| 51 |
-
print(" Registered ministral3 -> Ministral3CompatConfig (subclass)")
|
| 52 |
|
| 53 |
-
# 2. Register Model for this config
|
| 54 |
-
AutoModel.register(Ministral3CompatConfig,
|
| 55 |
-
print(" Registered Ministral3CompatConfig ->
|
| 56 |
|
| 57 |
except Exception as e:
|
| 58 |
print(f" ❌ Failed to register ministral3 config/model: {e}")
|
|
@@ -60,6 +61,7 @@ except Exception as e:
|
|
| 60 |
# Register Mistral3Config to a model class
|
| 61 |
# ... (rest of registration kept as is)
|
| 62 |
# ... (rest of registration kept as is)
|
|
|
|
| 63 |
print("🔧 Registering Mistral3 model class...")
|
| 64 |
try:
|
| 65 |
from transformers.models.mistral3.configuration_mistral3 import Mistral3Config
|
|
|
|
| 42 |
# Register 'ministral3' config to handle nested text_config
|
| 43 |
print("🔧 Registering ministral3 config...")
|
| 44 |
try:
|
| 45 |
+
# Use standard MistralConfig (not MinistralConfig) as base
|
| 46 |
+
from transformers import MistralConfig, MistralModel, AutoModel, AutoConfig
|
| 47 |
+
class Ministral3CompatConfig(MistralConfig):
|
| 48 |
model_type = "ministral3"
|
| 49 |
|
| 50 |
# 1. Register Config
|
| 51 |
AutoConfig.register("ministral3", Ministral3CompatConfig)
|
| 52 |
+
print(" Registered ministral3 -> Ministral3CompatConfig (subclass of MistralConfig)")
|
| 53 |
|
| 54 |
+
# 2. Register Model for this config
|
| 55 |
+
AutoModel.register(Ministral3CompatConfig, MistralModel)
|
| 56 |
+
print(" Registered Ministral3CompatConfig -> MistralModel")
|
| 57 |
|
| 58 |
except Exception as e:
|
| 59 |
print(f" ❌ Failed to register ministral3 config/model: {e}")
|
|
|
|
| 61 |
# Register Mistral3Config to a model class
|
| 62 |
# ... (rest of registration kept as is)
|
| 63 |
# ... (rest of registration kept as is)
|
| 64 |
+
# ... (rest of registration kept as is)
|
| 65 |
print("🔧 Registering Mistral3 model class...")
|
| 66 |
try:
|
| 67 |
from transformers.models.mistral3.configuration_mistral3 import Mistral3Config
|