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

Unable to use ESM6B through Forge - ESMProteinError #202

Open
Ty9Sandra opened this issue Feb 28, 2025 · 0 comments
Open

Unable to use ESM6B through Forge - ESMProteinError #202

Ty9Sandra opened this issue Feb 28, 2025 · 0 comments

Comments

@Ty9Sandra
Copy link

Dear ESMC Developer,

When I running the following snippet from the README to use ESMC 6B:

from esm.sdk.forge import ESM3ForgeInferenceClient
from esm.sdk.api import ESMProtein, LogitsConfig

# Apply for forge access and get an access token
forge_client = ESM3ForgeInferenceClient(model="esmc-6b-2024-12", url="https://forge.evolutionaryscale.ai", token="<your forge token>")
protein = ESMProtein(sequence="AAAAA")
try:
    protein_tensor = forge_client.encode(protein)
    print("Type of protein_tensor:", type(protein_tensor))
    if not isinstance(protein_tensor, ESMProteinTensor):
        raise TypeError("The encode method did not return an ESMProteinTensor instance. Type received: {}".format(type(protein_tensor)))
    logits_output = forge_client.logits(
        protein_tensor, LogitsConfig(sequence=True, return_embeddings=True)
    )
    print(logits_output.logits, logits_output.embeddings)
except Exception as e:
    print(f"An error occurred: {e}")

An error occurred: The encode method did not return an ESMProteinTensor instance. Type received: <class 'esm.sdk.api.ESMProteinError'>

It seems that there is something wrong with the code : protein_tensor = forge_client.encode(protein) , but I don't know why.

Thanks for your help.

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