From 343a4d8855d0496f2084d250ae17f725c437266d Mon Sep 17 00:00:00 2001 From: Sunny Liu <22844540+bursteratom@users.noreply.github.com> Date: Sun, 8 Dec 2024 16:39:05 -0500 Subject: [PATCH] Fixing issue#2134 Axolotl Crashes At The End Of Training If Base Model Is Local (#2140) --- src/axolotl/train.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/axolotl/train.py b/src/axolotl/train.py index 39af9f45c..8f50a243d 100644 --- a/src/axolotl/train.py +++ b/src/axolotl/train.py @@ -259,14 +259,7 @@ def train( model.save_pretrained(cfg.output_dir, safe_serialization=safe_serialization) if not cfg.hub_model_id: - from huggingface_hub import HfApi - from huggingface_hub.utils import RepositoryNotFoundError - try: - # Check to make sure the base model is from HuggingFace not a local directory - hf_api = HfApi() - hf_api.model_info(cfg.base_model) - model_card_kwarg = { "model_name": cfg.output_dir.lstrip("./") .encode("utf-8") @@ -283,7 +276,7 @@ def train( ] trainer.create_model_card(**model_card_kwarg) - except (AttributeError, UnicodeDecodeError, RepositoryNotFoundError): + except (AttributeError, UnicodeDecodeError): pass elif cfg.hub_model_id: # defensively push to the hub to ensure the model card is updated