Skip to content

Conversation

@hazemessamm
Copy link

@hazemessamm hazemessamm commented Sep 18, 2025

Hi, thanks for the great work!

I was working with some evaluation models that use ProtT5 and Ankh PLMs, and these models do not have a token; they only have token, so I handled their case in order to work properly with EvoProtGrad.

Decoded example for both ProtT5 and Ankh: MQMLKMGLV</s>

# This checks whether the gradient sequence length
# is exactly one more than the input sequence length.
elif oh_grad.shape[1] == self.chains_oh.shape[1] + 1:
oh_grad = oh_grad[:, :-1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that we can't guarantee that the last element of the gradient sequence is what should removed (why not the first element?)

@pemami4911
Copy link
Collaborator

Hi, thank you for this pull request!

Having this logic (for instances with and tokens) in _compute_gradients might be problematic: https://github.com/NREL/EvoProtGrad/pull/16/files#r2442682916

I'm thinking that we could move this logic out of _compute_gradients and into the expert's code, that way we can let each expert handle removal of its special tokens (, , etc.). This could be done in the Protein LM expert's __call__ function.

I think we would need to also add custom expert code for T5/Ankh though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants