Downloads · 30 days
26
100% of all-time downloads
palsetuf/BacPT-small
BacPT-small is a feature extraction model from palsetuf. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
BacPT-small is a bacterial proteome foundation model that contextualizes ESM2 protein embeddings using the order of proteins in a genome. It uses a 10-layer RoBERTa backbone with relative key-query position embeddings…
Downloads · 30 days
26
100% of all-time downloads
All-time downloads
26
Public
Parameters
51.2M
205 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors205 MB · 100%
How the weights are stored.
F3251.2M · 100%
From the Hugging Face model README
BacPT-small is a bacterial proteome foundation model that contextualizes ESM2 protein embeddings using the order of proteins in a genome. It uses a 10-layer RoBERTa backbone with relative key-query position embeddings and contains 51,243,360 trainable and non-trainable model parameters.
This repository contains the inference-only weights from training checkpoint epoch 1107, the exact model configuration, and the fitted input scaler.
The command accepts a protein FASTA already ordered by genomic position. It does not annotate a nucleotide genome or determine gene order. The supplied pipeline:
esm2_t12_35M_UR50D, averaging layer 12 over amino-acid positions;pip install -r requirements.txt
Download this model repository and run:
python inference.py \
--fasta ordered_proteins.faa \
--output bacpt_small_embeddings.npz \
--device cuda
The original FAIR ESM v2.0.0 code and ESM2 weights are downloaded through
PyTorch Hub on first use. Add --all-layers to retain every hidden layer.
The output NPZ contains:
protein_ids: identifiers in model order;last_hidden_state: contextual protein embeddings with shape
[proteins, 480];reconstruction: reconstructed ESM2 vectors produced by the self-supervised
training head, with shape [proteins, 480];omitted_protein_ids: proteins longer than 2,250 amino acids; andtruncated_protein_ids: proteins beyond model position 5,000.With --all-layers, it also contains hidden_states with shape
[11, proteins, 480], including the embedding output and all 10 transformer
layers.
CPU inference is supported in float32. CUDA inference uses float16 autocasting to reproduce the original inference procedure more closely.
BacPT-small produces contextual representations for proteins in complete or draft bacterial proteomes. These representations are intended as features for research tasks such as functional, genomic-context, trait, and ecological prediction.
The model expects proteins to be provided in genomic order. It does not annotate genomes, translate nucleotide sequences, handle circular-genome rotation, or choose an ordering for unordered proteins. It was trained on bacterial genomes and has not been validated as a general model for archaeal, eukaryotic, or viral proteomes. Downstream predictions require separate task models and validation.
Bacterial proteome foundation model enhances functional prediction from enzymes to ecological interactions. Citation details will be added when the manuscript record is public.