westlake-repl / ProTrek_35M

huggingface.co
Total runs: 4
24-hour runs: 0
7-day runs: -1
30-day runs: -9
Model's Last Updated: Agosto 19 2025

Introduction of ProTrek_35M

Model Details of ProTrek_35M

Github repo: https://github.com/westlake-repl/ProTrek

Overview

ProTrek is a multimodal model that integrates protein sequence, protein structure, and text information for better protein understanding. It adopts contrastive learning to learn the representations of protein sequence and structure. During the pre-training phase, we calculate the InfoNCE loss for each two modalities as CLIP does.

Model architecture

Protein sequence encoder : esm2_t12_35M_UR50D

Protein structure encoder : foldseek_t12_35M (identical architecture with esm2 except that the vocabulary only contains 3Di tokens)

Text encoder : BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext

Obtain embeddings and calculate similarity score (please clone our repo first)
import torch

from model.ProtTrek.protrek_trimodal_model import ProTrekTrimodalModel
from utils.foldseek_util import get_struc_seq

# Load model
config = {
    "protein_config": "weights/ProTrek_35M_UniRef50/esm2_t12_35M_UR50D",
    "text_config": "weights/ProTrek_35M_UniRef50/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext",
    "structure_config": "weights/ProTrek_35M_UniRef50/foldseek_t12_35M",
    "load_protein_pretrained": False,
    "load_text_pretrained": False,
    "from_checkpoint": "weights/ProTrek_35M_UniRef50/ProTrek_35M_UniRef50.pt"
}

device = "cuda"
model = ProTrekTrimodalModel(**config).eval().to(device)

# Load protein and text
pdb_path = "example/8ac8.cif"
seqs = get_struc_seq("bin/foldseek", pdb_path, ["A"])["A"]
aa_seq = seqs[0]
foldseek_seq = seqs[1].lower()
text = "Replication initiator in the monomeric form, and autogenous repressor in the dimeric form."

with torch.no_grad():
    # Obtain protein sequence embedding
    seq_embedding = model.get_protein_repr([aa_seq])
    print("Protein sequence embedding shape:", seq_embedding.shape)
    
    # Obtain protein structure embedding
    struc_embedding = model.get_structure_repr([foldseek_seq])
    print("Protein structure embedding shape:", struc_embedding.shape)
    
    # Obtain text embedding
    text_embedding = model.get_text_repr([text])
    print("Text embedding shape:", text_embedding.shape)
    
    # Calculate similarity score between protein sequence and structure
    seq_struc_score = seq_embedding @ struc_embedding.T / model.temperature
    print("Similarity score between protein sequence and structure:", seq_struc_score.item())

    # Calculate similarity score between protein sequence and text
    seq_text_score = seq_embedding @ text_embedding.T / model.temperature
    print("Similarity score between protein sequence and text:", seq_text_score.item())
    
    # Calculate similarity score between protein structure and text
    struc_text_score = struc_embedding @ text_embedding.T / model.temperature
    print("Similarity score between protein structure and text:", struc_text_score.item())
   

"""
Protein sequence embedding shape: torch.Size([1, 1024])
Protein structure embedding shape: torch.Size([1, 1024])
Text embedding shape: torch.Size([1, 1024])
Similarity score between protein sequence and structure: 38.83826446533203
Similarity score between protein sequence and text: 17.90523338317871
Similarity score between protein structure and text: 18.044755935668945
"""

Runs of westlake-repl ProTrek_35M on huggingface.co

4
Total runs
0
24-hour runs
0
3-day runs
-1
7-day runs
-9
30-day runs

More Information About ProTrek_35M huggingface.co Model

More ProTrek_35M license Visit here:

https://choosealicense.com/licenses/mit

ProTrek_35M huggingface.co

ProTrek_35M huggingface.co is an AI model on huggingface.co that provides ProTrek_35M's model effect (), which can be used instantly with this westlake-repl ProTrek_35M model. huggingface.co supports a free trial of the ProTrek_35M model, and also provides paid use of the ProTrek_35M. Support call ProTrek_35M model through api, including Node.js, Python, http.

westlake-repl ProTrek_35M online free

ProTrek_35M huggingface.co is an online trial and call api platform, which integrates ProTrek_35M's modeling effects, including api services, and provides a free online trial of ProTrek_35M, you can try ProTrek_35M online for free by clicking the link below.

westlake-repl ProTrek_35M online free url in huggingface.co:

https://huggingface.co/westlake-repl/ProTrek_35M

ProTrek_35M install

ProTrek_35M is an open source model from GitHub that offers a free installation service, and any user can find ProTrek_35M on GitHub to install. At the same time, huggingface.co provides the effect of ProTrek_35M install, users can directly use ProTrek_35M installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

ProTrek_35M install url in huggingface.co:

https://huggingface.co/westlake-repl/ProTrek_35M

Url of ProTrek_35M

Provider of ProTrek_35M huggingface.co

westlake-repl
ORGANIZATIONS

Other API from westlake-repl

huggingface.co

Total runs: 5
Run Growth: 0
Growth Rate: 0.00%
Updated:Junho 10 2025