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

Fix a bug in unfreeze #660

Merged
merged 1 commit into from
Nov 18, 2023
Merged
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
18 changes: 10 additions & 8 deletions python/graphstorm/model/lm_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,11 @@ def freeze(self, _):
def unfreeze(self):
""" Disable Bert caching
"""
self.use_cache = False
# We should clear up the LM cache here. When someone calls unfreeze,
# we expect that the LM model will be fine-tuned.
self.lm_emb_cache.clear_cache()
if self.num_train > 0:
self.use_cache = False
# We should clear up the LM cache here. When someone calls unfreeze,
# we expect that the LM model will be fine-tuned.
self.lm_emb_cache.clear_cache()

def require_cache_embed(self):
""" Whether to cache the embeddings for inference.
Expand Down Expand Up @@ -726,10 +727,11 @@ def freeze(self, _):
def unfreeze(self):
""" Disable Bert caching
"""
self.use_cache = False
# We should clear up the LM cache here. When someone calls unfreeze,
# we expect that the LM model will be fine-tuned.
self.lm_emb_cache.clear_cache()
if self.num_train > 0:
self.use_cache = False
# We should clear up the LM cache here. When someone calls unfreeze,
# we expect that the LM model will be fine-tuned.
self.lm_emb_cache.clear_cache()

def require_cache_embed(self):
""" Whether to cache the embeddings for inference.
Expand Down
Loading