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

Implemented the functionality to use custom embeddings for Mamba models. #35

Merged
merged 10 commits into from
May 6, 2024

Conversation

Adibvafa
Copy link
Member

@Adibvafa Adibvafa commented May 5, 2024

PR Type

Feature

Short Description

Implemented the functionality to use custom embeddings for Mamba models.

Tests Added

None

@Adibvafa Adibvafa marked this pull request as draft May 5, 2024 00:14
@Adibvafa Adibvafa self-assigned this May 5, 2024
@Adibvafa Adibvafa added the enhancement New feature or request label May 5, 2024
@Adibvafa Adibvafa requested a review from amrit110 May 6, 2024 21:07
@Adibvafa Adibvafa marked this pull request as ready for review May 6, 2024 21:08
@Adibvafa
Copy link
Member Author

Adibvafa commented May 6, 2024

@amrit110 Note that in file mamba_utils.py, the checker changes the docstring for forward function of class MambaForSequenceClassification, which results in failures due to necessary requirements of the HuggingFace library.

The final merged version to main should be this:

        r"""
        labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
            Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
            config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
            `config.num_labels > 1` a classification loss is computed (Cross-Entropy).

        Returns:
        """

@amrit110
Copy link
Member

amrit110 commented May 6, 2024

Hmm @Adibvafa , do you mean the change to the docstring violates what huggingface needs to be part of their repo?

@amrit110 amrit110 merged commit 426658f into main May 6, 2024
0 of 2 checks passed
@amrit110 amrit110 deleted the feature/mamba branch May 6, 2024 22:27
@Adibvafa
Copy link
Member Author

Adibvafa commented May 7, 2024

Hmm @Adibvafa , do you mean the change to the docstring violates what huggingface needs to be part of their repo?

Yes, exactly! It should end with "Returns:". If its hard to configure this exception, I can create an example to add to docstring so it won't break?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants