YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
gtCLIP β Gene-set Text CLIP
A CLIP-style model that aligns gene set embeddings (via GSFM) with biomedical text embeddings (via S-PubMedBert-MS-MARCO) in a shared latent space.
Quick Start
GIT_LFS_SKIP_SMUDGE=1 pip install git+https://huggingface.co/maayanlab/gsfm
pip install sentence-transformers huggingface_hub
from huggingface_hub import hf_hub_download
import importlib.util
py_path = hf_hub_download("DaveLab/gtCLIP", "gtCLIP.py")
spec = importlib.util.spec_from_file_location("gtCLIP", py_path)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
GeneSetTextEncoder = mod.GeneSetTextEncoder
model = GeneSetTextEncoder.from_pretrained("DaveLab/gtCLIP", device="cuda")
# Encode a gene set
gene_emb = model.encode_gene_symbols(["TP53", "BRCA1", "MYC", "CDK2"])
# Encode a text description
text_emb = model.encode_text_normalized(["DNA damage repair pathway"])
# Compute similarity
similarity = (gene_emb @ text_emb.T).item()
print(f"Similarity: {similarity:.4f}")
Files
| File | Description |
|---|---|
gtCLIP.py |
Model class definition |
gtCLIP.pt |
Trained weights + config |
config.json |
Architecture hyperparameters |
Architecture
- Gene encoder: GSFM (frozen or partially fine-tuned) β projection MLP β shared space
- Text encoder: PubMedBERT (frozen or partially fine-tuned) β projection MLP β shared space
- Training: Contrastive CLIP loss with gene-set overlap soft targets + reconstruction auxiliary loss
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support