def maybe_untie_word_embeddings(self):
        """Untie the word embeddings if they are tied."""
        if self.config.tie_word_embeddings:
            self.config.tie_word_embeddings = False
            self.model.config.tie_word_embeddings = False

            self.get_lm_head(False).weight = nn.Parameter(self.get_embeds(False)[0].weight.clone().detach())
            logger.debug("Untied word embeddings.")
Untie the word embeddings if they are tied.
olive/common/hf/wrapper.py