From 8d9a67abc6daa03de7c6773cfa5558c33621fd4b Mon Sep 17 00:00:00 2001 From: Zeming Lin Date: Wed, 27 May 2026 17:38:49 +0000 Subject: [PATCH] Fix Biohub Platform SDK snippets (ESMC + ESMFold2) and use carbonic anhydrase II --- README.md | 33 +++++++++++++++++++++++-------- cookbook/tutorials/esmfold2.ipynb | 3 +-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8972045..9289487 100644 --- a/README.md +++ b/README.md @@ -110,14 +110,24 @@ Then import the necessary libraries and instantiate your desired model. ```py from esm.sdk import esmc_client - +from esm.sdk.api import ESMProtein, LogitsConfig + +# Human carbonic anhydrase II (PDB 2CBA) +protein = ESMProtein( + sequence=( + "MSHHWGYGKHNGPEHWHKDFPIAKGERQSPVDIDTHTAKYDPSLKPLSVSYDQATSLRILNNGHAFNVEFDD" + "SQDKAVLKGGPLDGTYRLIQFHFHWGSLDGQGSEHTVDKKKYAAELHLVHWNTKYGDFGKAVQQPDGLAVL" + "GIFLKVGSAKPGLQKVVDVLDSIKTKGKSADFTNFDPRGLLPESLDYWTYPGSLTTPPLLECVTWIVLKEP" + "ISVSSEQVLKFRKLNFNGEGEPEELMVDNWRPAQPLKNRQIKASFK" + ) +) model = esmc_client( model="esmc-600m-2024-12", url="https://biohub.ai", token="" ) protein_tensor = model.encode(protein) logits_output = model.logits( - protein_tensor, LogitsConfig(sequence=True, return_embeddings=True) + protein_tensor, LogitsConfig(sequence=True, return_embeddings=True) ) print(logits_output.logits, logits_output.embeddings) @@ -234,7 +244,8 @@ Import the necessary libraries. ```py from esm.sdk.forge import SequenceStructureForgeInferenceClient -from esm.sdk.api import ESMProtein, ESMProteinError, LogitsConfig, LogitsOutput +from esm.sdk.api import FoldingConfig +from esm.utils.structure.input_builder import ProteinInput, StructurePredictionInput ``` Call the inference client with the selected model of choice and replace with your token name. @@ -242,13 +253,19 @@ Call the inference client with the selected model of choice and replace