Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,11 @@ def __init__(

super().__init__(**kwargs)

# Due to a mismatch at model addition-time, the `tie_word_embeddings` was saved in the text config, even
# though it concerns the main model, while it was set to False by default in the main model... So we hardcode a fix here
if not self.tie_word_embeddings and self.text_config.tie_word_embeddings:
self.tie_word_embeddings = True
self.text_config.tie_word_embeddings = False


__all__ = ["LlavaNextVideoConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ def __init__(

super().__init__(**kwargs)

# Due to a mismatch at model addition-time, the `tie_word_embeddings` was saved in the text config, even
# though it concerns the main model, while it was set to False by default in the main model... So we hardcode a fix here
if not self.tie_word_embeddings and self.text_config.tie_word_embeddings:
self.tie_word_embeddings = True
self.text_config.tie_word_embeddings = False


class LlavaNextVideoModelOutputWithPast(LlavaNextModelOutputWithPast):
r"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,10 @@ def __init__(

super().__init__(**kwargs)

# Due to a mismatch at model addition-time, the `tie_word_embeddings` was saved in the text config, even
# though it concerns the main model, while it was set to False by default in the main model... So we hardcode a fix here
self.tie_word_embeddings = self.tie_word_embeddings or self.text_config.tie_word_embeddings
self.text_config.tie_word_embeddings = False


__all__ = ["LlavaOnevisionConfig"]