Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Conversation

@shubham-s-agarwal
Copy link
Collaborator

This change modifies the BERT model loading logic to support offline initialization from local files only, removing any dependency on online resources.

New behavior:

  • If load_bert_pretrained_weights=True: load pretrained BERT weights (requires internet access).
  • If load_bert_pretrained_weights=False: initialize BERT with random weights

Note: we always recommend loading the model weights from the provided model packs. In case user does not want to load the model pack, then using load_bert_pretrained_weights=False is unadvisable, however in our scripts, we always load the model packs.

  • If saved_dir_path is provided:
    • Load BERT config from local file in the specified path.
  • If saved_dir_path is not provided:
    • Fallback to downloading config from HuggingFace.

Allow model loading entirely from local files
@shubham-s-agarwal shubham-s-agarwal self-assigned this Jul 23, 2025
@shubham-s-agarwal shubham-s-agarwal added the enhancement New feature or request label Jul 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants