Instructions to use microsoft/colipri with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- COLIPRI
How to use microsoft/colipri with COLIPRI:
pip install colipri
from colipri import get_model from colipri import get_processor from colipri import load_sample_ct from colipri import ZeroShotImageClassificationPipeline model = get_model().cuda() processor = get_processor() pipeline = ZeroShotImageClassificationPipeline("microsoft/colipri", processor) image = load_sample_ct() pipeline(image, ["No lung nodules", "Lung nodules"]) - Notebooks
- Google Colab
- Kaggle
Mask padding tokens during text pooling
#7
by fepegar - opened
Pass the tokenizer attention mask into text pooling so padding tokens cannot influence the pooled representation. Use the mask both when constructing the mean attention query and as the multi-head attention key-padding mask. Add regression tests covering padding invariance and invalid masks.
fepegar changed pull request status to open
fepegar changed pull request status to merged