lazyslide_models.multimodal.KEEP

Contents

lazyslide_models.multimodal.KEEP#

class KEEP(model_path=None, token=None)#

Bases: ImageTextModel

keep 🤗Hugging Face GitHub Paper MIT [Zhou et al., 2026] Knowledge-enhanced pretraining for vision-language pathology foundation model on cancer diagnosis KEEP (KnowledgE-Enhanced Pathology) image-text model.

A ViT-L/16 image encoder and a BERT text encoder, aligned using a disease knowledge graph. It is strong at zero-shot cancer detection and subtyping.

The model is built here from its config and weights instead of its remote code. That code replaces timm’s LayerScale for the whole process, so every timm ViT built after it gets a renamed parameter, and on current timm it does not load at all: its replacement rejects the device and dtype arguments timm now passes.