Upload train_aviation.py with huggingface_hub
Browse files- train_aviation.py +12 -5
train_aviation.py
CHANGED
|
@@ -42,16 +42,23 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
|
| 42 |
# Register 'ministral3' config to handle nested text_config
|
| 43 |
print("🔧 Registering ministral3 config...")
|
| 44 |
try:
|
| 45 |
-
from transformers import
|
| 46 |
-
|
| 47 |
-
model_type = "ministral3"
|
| 48 |
-
|
| 49 |
AutoConfig.register("ministral3", MinistralConfig)
|
| 50 |
-
print(" Registered ministral3 -> MinistralConfig (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
except Exception as e:
|
| 52 |
print(f" ❌ Failed to register ministral3 config: {e}")
|
| 53 |
|
| 54 |
# Register Mistral3Config to a model class
|
|
|
|
| 55 |
print("🔧 Registering Mistral3 model class...")
|
| 56 |
try:
|
| 57 |
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 |
+
from transformers import MinistralConfig
|
| 46 |
+
# We don't need to subclass if we just register it
|
|
|
|
|
|
|
| 47 |
AutoConfig.register("ministral3", MinistralConfig)
|
| 48 |
+
print(" Registered ministral3 -> MinistralConfig (native)")
|
| 49 |
+
except ImportError:
|
| 50 |
+
print(" ❌ MinistralConfig not found in transformers! Trying fallback...")
|
| 51 |
+
# Fallback to subclassing MistralConfig if MinistralConfig is missing (unlikely given trace)
|
| 52 |
+
from transformers import MistralConfig
|
| 53 |
+
class MinistralConfigSub(MistralConfig):
|
| 54 |
+
model_type = "ministral3"
|
| 55 |
+
AutoConfig.register("ministral3", MinistralConfigSub)
|
| 56 |
+
print(" Registered ministral3 -> MinistralConfig (subclass fallback)")
|
| 57 |
except Exception as e:
|
| 58 |
print(f" ❌ Failed to register ministral3 config: {e}")
|
| 59 |
|
| 60 |
# Register Mistral3Config to a model class
|
| 61 |
+
# ... (rest of registration kept as is)
|
| 62 |
print("🔧 Registering Mistral3 model class...")
|
| 63 |
try:
|
| 64 |
from transformers.models.mistral3.configuration_mistral3 import Mistral3Config
|