Skip to content

Commit

Permalink
use default HF HUB token when checking for base model info (predibase…
Browse files Browse the repository at this point in the history
  • Loading branch information
noyoshi authored Apr 19, 2024
1 parent 3ffa99a commit 8060fe3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/lorax_server/utils/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def _load_and_merge(
return module_map, adapter_config, merged_weight_names, tokenizer


def check_architectures(model_id: str, adapter_id: str, adapter_config: "AdapterConfig", api_token: str):
def check_architectures(model_id: str, adapter_id: str, adapter_config: "AdapterConfig"):
try:
expected_config = AutoConfig.from_pretrained(model_id, token=api_token)
model_config = AutoConfig.from_pretrained(adapter_config.base_model_name_or_path, token=api_token)
expected_config = AutoConfig.from_pretrained(model_id)
model_config = AutoConfig.from_pretrained(adapter_config.base_model_name_or_path)
except Exception as e:
warnings.warn(
f"Unable to check architecture compatibility for adapter '{adapter_id}' "
Expand Down Expand Up @@ -123,7 +123,7 @@ def load_module_map(
config_path = get_config_path(adapter_id, adapter_source)
adapter_config = source.load_config()
if adapter_config.base_model_name_or_path != model_id:
check_architectures(model_id, adapter_id, adapter_config, api_token)
check_architectures(model_id, adapter_id, adapter_config)

try:
adapter_tokenizer = AutoTokenizer.from_pretrained(config_path, token=api_token)
Expand Down

0 comments on commit 8060fe3

Please sign in to comment.