Upload train_aviation.py with huggingface_hub
Browse files- train_aviation.py +12 -0
train_aviation.py
CHANGED
|
@@ -39,6 +39,18 @@ from peft import LoraConfig, prepare_model_for_kbit_training, get_peft_model
|
|
| 39 |
from trl import SFTTrainer, SFTConfig
|
| 40 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, AutoConfig
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# Register Mistral3Config to a model class
|
| 43 |
print("🔧 Registering Mistral3 model class...")
|
| 44 |
try:
|
|
|
|
| 39 |
from trl import SFTTrainer, SFTConfig
|
| 40 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, AutoConfig
|
| 41 |
|
| 42 |
+
# Register 'ministral3' config to handle nested text_config
|
| 43 |
+
print("🔧 Registering ministral3 config...")
|
| 44 |
+
try:
|
| 45 |
+
from transformers import MistralConfig, AutoConfig
|
| 46 |
+
class MinistralConfig(MistralConfig):
|
| 47 |
+
model_type = "ministral3"
|
| 48 |
+
|
| 49 |
+
AutoConfig.register("ministral3", MinistralConfig)
|
| 50 |
+
print(" Registered ministral3 -> MinistralConfig (subclass)")
|
| 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:
|