Skip to content

Add convenience function to load models from Hugging Face.#407

Merged
favyen2 merged 3 commits intomainfrom
favyen/20251023-model-loader
Oct 23, 2025
Merged

Add convenience function to load models from Hugging Face.#407
favyen2 merged 3 commits intomainfrom
favyen/20251023-model-loader

Conversation

@favyen2
Copy link
Copy Markdown
Collaborator

@favyen2 favyen2 commented Oct 23, 2025

Note

Adds a utility to build OlmoEarth models from Hugging Face config and optionally load weights.

  • Python / Pretrain:
    • New module olmoearth_pretrain/model_loader.py:
      • Introduces ModelID enum with OLMOEARTH_V1_NANO, OLMOEARTH_V1_TINY, OLMOEARTH_V1_BASE.
      • Adds load_model(model_id, load_weights=True) to download config.json, build the model via Config.from_dict(...).build(), and optionally fetch weights.pth and load_state_dict from Hugging Face.

Written by Cursor Bugbot for commit d53cbc3. This will update automatically on new commits. Configure here.

@cursor
Copy link
Copy Markdown

cursor Bot commented Oct 23, 2025

Bug: Model Loading Ignores load_weights Parameter

The load_model function unconditionally downloads the .pth weights file from Hugging Face, even when load_weights=False. This contradicts the docstring, which states that setting load_weights=False should skip downloading the weights, leading to unnecessary bandwidth usage and increased load times.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Collaborator

@Hgherzog Hgherzog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cursor[bot]

This comment was marked as outdated.

@favyen2 favyen2 merged commit aefba0c into main Oct 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants