Skip to content

Commit

Permalink
handle case where base_model_name_or_path is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Oct 31, 2024
1 parent 19dbc44 commit 77c8627
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion convert_lora_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ def load_hparams_from_hf(hf_model_id: str) -> dict[str, Any]:
if "base_model_name_or_path" in lparams:
model_id = lparams["base_model_name_or_path"]
logger.info(f"Loading base model from Hugging Face: {model_id}")
hparams = load_hparams_from_hf(model_id)
try:
hparams = load_hparams_from_hf(model_id)
except OSError as e:
logger.error(f"Failed to load base model config: {e}")
logger.error("Please try downloading the base model and add its path to --base")
sys.exit(1)
else:
logger.error("'base_model_name_or_path' is not found in adapter_config.json")
logger.error("Base model config is required. Please download the base model and add its path to --base")
Expand Down

0 comments on commit 77c8627

Please sign in to comment.