Training in progress - step 500
Browse files- asr_modeling.py +3 -1
asr_modeling.py
CHANGED
|
@@ -827,8 +827,10 @@ class ASRModel(PreTrainedModel, GenerationMixin):
|
|
| 827 |
self.feature_extractor.save_pretrained(save_dir)
|
| 828 |
|
| 829 |
# Save LoRA adapters if present (creates adapter_model.safetensors and adapter_config.json)
|
|
|
|
|
|
|
| 830 |
if hasattr(self.language_model, "peft_config"):
|
| 831 |
-
self.language_model.save_pretrained(save_dir)
|
| 832 |
|
| 833 |
# Add processor auto_map to preprocessor_config.json
|
| 834 |
config_path = save_dir / "preprocessor_config.json"
|
|
|
|
| 827 |
self.feature_extractor.save_pretrained(save_dir)
|
| 828 |
|
| 829 |
# Save LoRA adapters if present (creates adapter_model.safetensors and adapter_config.json)
|
| 830 |
+
# Don't save embedding layers - the <audio> token embedding is never used
|
| 831 |
+
# (it's replaced with projected audio embeddings before the LLM sees it)
|
| 832 |
if hasattr(self.language_model, "peft_config"):
|
| 833 |
+
self.language_model.save_pretrained(save_dir, save_embedding_layers=False)
|
| 834 |
|
| 835 |
# Add processor auto_map to preprocessor_config.json
|
| 836 |
config_path = save_dir / "preprocessor_config.json"
|