Run this model with HF Jobs
Run Synthyra/ESMplusplus_large on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Synthyra/ESMplusplus_large. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Synthyra/ESMplusplus_large on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Synthyra/ESMplusplus_large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESMplusplus_large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Synthyra/ESMplusplus_large", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Synthyra/ESMplusplus_large", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload modeling_esm_plusplus.py with huggingface_hub
Browse files470 unmodified lines471472473474475476477168 unmodified lines646647648649650651446 unmodified lines109810991100110111021103110411051106470 unmodified linesreturn flash_kernel, flash_kernel_variantFLASH_KERNEL, FLASH_KERNEL_VARIANT = _try_get_kernels_flash()def _kernels_flash_forward(168 unmodified linesassert requested_backend in VALID_ATTENTION_BACKENDS, (f"Unsupported attention backend: {requested_backend}. Expected one of {VALID_ATTENTION_BACKENDS}.")if requested_backend == AttentionBackend.AUTO.value:if FLASH_KERNEL is not None:resolved = AttentionBackend.KERNELS_FLASH446 unmodified linesflex_block_mask: "BlockMask | None" = None,) -> tuple[torch.Tensor, None]:assert flex_attention is not None, "Flex attention is not available in this environment."assert query_BHLD.dtype in (torch.float16, torch.bfloat16), (f"Flex attention requires float16 or bfloat16, got {query_BHLD.dtype}.")fn = _get_flex_attention_fn()context_BHLD = fn(query_BHLD, key_BHLD, value_BHLD, block_mask=flex_block_mask, scale=self.scale)return rearrange(context_BHLD, "b h s d -> b s (h d)"), None470 unmodified lines471472473474475476477478479480481482483484485486487168 unmodified lines656657658659660661662663446 unmodified lines111011111112111311141115470 unmodified linesreturn flash_kernel, flash_kernel_variant_FLASH_KERNELS_LOADED = FalseFLASH_KERNEL = NoneFLASH_KERNEL_VARIANT = Nonedef _ensure_flash_kernels_loaded():global _FLASH_KERNELS_LOADED, FLASH_KERNEL, FLASH_KERNEL_VARIANTif _FLASH_KERNELS_LOADED:return_FLASH_KERNELS_LOADED = TrueFLASH_KERNEL, FLASH_KERNEL_VARIANT = _try_get_kernels_flash()def _kernels_flash_forward(168 unmodified linesassert requested_backend in VALID_ATTENTION_BACKENDS, (f"Unsupported attention backend: {requested_backend}. Expected one of {VALID_ATTENTION_BACKENDS}.")if requested_backend in (AttentionBackend.AUTO.value, AttentionBackend.KERNELS_FLASH.value):_ensure_flash_kernels_loaded()if requested_backend == AttentionBackend.AUTO.value:if FLASH_KERNEL is not None:resolved = AttentionBackend.KERNELS_FLASH446 unmodified linesflex_block_mask: "BlockMask | None" = None,) -> tuple[torch.Tensor, None]:assert flex_attention is not None, "Flex attention is not available in this environment."fn = _get_flex_attention_fn()context_BHLD = fn(query_BHLD, key_BHLD, value_BHLD, block_mask=flex_block_mask, scale=self.scale)return rearrange(context_BHLD, "b h s d -> b s (h d)"), None
modeling_esm_plusplus.py+13-4