Skip to content

Commit

Permalink
Fix test (#2435)
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerzr authored Feb 12, 2024
1 parent b3d2111 commit 5a39359
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/accelerate/commands/estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def create_empty_model(model_name: str, library_name: str, trust_remote_code: bo
f"To check `{model_name}`, `transformers` must be installed. Please install it via `pip install transformers`"
)
print(f"Loading pretrained config for `{model_name}` from `transformers`...")
if model_info.config is None:
raise RuntimeError(f"Tried to load `{model_name}` with `transformers` but it does not have any metadata.")

auto_map = model_info.config.get("auto_map", False)
config = AutoConfig.from_pretrained(model_name, trust_remote_code=trust_remote_code, token=access_token)
Expand Down

0 comments on commit 5a39359

Please sign in to comment.