Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply a more defensive way to fix redownloading issue #55

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kimm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
from kimm._src.utils.model_registry import list_models
from kimm._src.version import version

__version__ = "0.2.4"
__version__ = "0.2.5"
8 changes: 8 additions & 0 deletions kimm/_src/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ def get_config(self):
def fix_config(self, config: typing.Dict):
return config

@classmethod
def from_config(cls, config, custom_objects=None):
# Set `self._weight` to `None` to avoid redownloading issue.
config = config.copy()
if "weights" in config:
config["weights"] = None
return cls(**config)

def __repr__(self):
repr_str = (
f"<{self.__class__.__name__} "
Expand Down
2 changes: 1 addition & 1 deletion kimm/_src/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from kimm._src.kimm_export import kimm_export

__version__ = "0.2.4"
__version__ = "0.2.5"


@kimm_export("kimm")
Expand Down