Fill-Mask
Transformers
PyTorch
Safetensors
English
nomic_bert
custom_code
zpn commited on
Commit
2c2561b
1 Parent(s): 3ab0e96

update load_from_state_dict

Browse files
Files changed (1) hide show
  1. modeling_hf_nomic_bert.py +6 -2
modeling_hf_nomic_bert.py CHANGED
@@ -60,10 +60,14 @@ def state_dict_from_pretrained(model_name, safe_serialization=False, device=None
60
  load_safe = True
61
  else: # Try loading from HF hub instead of from local files
62
  weight_name = WEIGHTS_NAME if not safe_serialization else SAFE_WEIGHTS_NAME
63
- resolved_archive_file = cached_file(model_name, weight_name, _raise_exceptions_for_missing_entries=False)
 
 
64
  if resolved_archive_file is None:
65
  weight_index = WEIGHTS_INDEX_NAME if not safe_serialization else SAFE_WEIGHTS_INDEX_NAME
66
- resolved_archive_file = cached_file(model_name, weight_index, _raise_exceptions_for_missing_entries=False)
 
 
67
  if resolved_archive_file is not None:
68
  is_sharded = True
69
 
 
60
  load_safe = True
61
  else: # Try loading from HF hub instead of from local files
62
  weight_name = WEIGHTS_NAME if not safe_serialization else SAFE_WEIGHTS_NAME
63
+ resolved_archive_file = cached_file(
64
+ model_name, weight_name, token=True, _raise_exceptions_for_missing_entries=False
65
+ )
66
  if resolved_archive_file is None:
67
  weight_index = WEIGHTS_INDEX_NAME if not safe_serialization else SAFE_WEIGHTS_INDEX_NAME
68
+ resolved_archive_file = cached_file(
69
+ model_name, weight_index, token=True, _raise_exceptions_for_missing_entries=False
70
+ )
71
  if resolved_archive_file is not None:
72
  is_sharded = True
73