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

How to generate embeddings for very long protein using EMSC #201

Open
soumitrakp opened this issue Feb 27, 2025 · 0 comments
Open

How to generate embeddings for very long protein using EMSC #201

soumitrakp opened this issue Feb 27, 2025 · 0 comments

Comments

@soumitrakp
Copy link

Dear ESMC Developer,

I am attempting to generate embeddings for a set of proteins, including a particularly large protein (>34,000 residues) — ENSMUSP00000097561.4 (mouse heart muscle gene titin). However, I am encountering a CUDA memory limitation error when processing this sequence.

I am using the following code snippet:

EMBEDDING_CONFIG = LogitsConfig(
    sequence=True, return_embeddings=True, return_hidden_states=True
)

def embed_sequence(model: ESM3InferenceClient, sequence: str) -> LogitsOutput:
    protein = ESMProtein(sequence=sequence)
    protein_tensor = model.encode(protein)
    output = model.logits(protein_tensor, EMBEDDING_CONFIG)
    return output

Could you please suggest an approach to handle these types of long proteins?

Thank you for your time and assistance.

Best regards,
Soumitra

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

No branches or pull requests

1 participant