From aa64f086a2a229315e5a52050600a64872833580 Mon Sep 17 00:00:00 2001 From: Marc Sun <57196510+SunMarc@users.noreply.github.com> Date: Mon, 6 May 2024 14:01:26 +0200 Subject: [PATCH] Fix llava next tie_word_embeddings config (#30640) * fix llava next embedding * add docstring * Update src/transformers/models/llava_next/configuration_llava_next.py Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com> --------- Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com> --- .../models/llava_next/configuration_llava_next.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/transformers/models/llava_next/configuration_llava_next.py b/src/transformers/models/llava_next/configuration_llava_next.py index d7b3ff7233f3a4..1097a716bad95d 100644 --- a/src/transformers/models/llava_next/configuration_llava_next.py +++ b/src/transformers/models/llava_next/configuration_llava_next.py @@ -55,6 +55,8 @@ class LlavaNextConfig(PretrainedConfig): image_grid_pinpoints (`List`, *optional*, defaults to `[[336, 672], [672, 336], [672, 672], [1008, 336], [336, 1008]]`): A list of possible resolutions to use for processing high resolution images. Each item in the list should be a tuple or list of the form `(height, width)`. + tie_word_embeddings (`bool`, *optional*, defaults to `False`): + Whether the model's input and output word embeddings should be tied. Example: @@ -90,6 +92,7 @@ def __init__( vision_feature_select_strategy="default", vision_feature_layer=-2, image_grid_pinpoints=None, + tie_word_embeddings=False, **kwargs, ): self.ignore_index = ignore_index @@ -138,4 +141,4 @@ def __init__( self.text_config = text_config - super().__init__(**kwargs) + super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)