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
Remove redundant shapes from pooling docstrings
Browse filesCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8a255805-976d-4261-b430-561adafb3cc6
- src/colipri/pooling.py +2 -3
src/colipri/pooling.py
CHANGED
|
@@ -14,9 +14,8 @@ def _get_valid_token_mask(
|
|
| 14 |
"""Get a validated Boolean mask for valid sequence positions.
|
| 15 |
|
| 16 |
Args:
|
| 17 |
-
sequence: Sequence embeddings
|
| 18 |
-
attention_mask: Mask
|
| 19 |
-
identify valid positions.
|
| 20 |
|
| 21 |
Returns:
|
| 22 |
A Boolean mask on the sequence device, or `None` when no mask is provided.
|
|
|
|
| 14 |
"""Get a validated Boolean mask for valid sequence positions.
|
| 15 |
|
| 16 |
Args:
|
| 17 |
+
sequence: Sequence embeddings.
|
| 18 |
+
attention_mask: Mask where nonzero entries identify valid positions.
|
|
|
|
| 19 |
|
| 20 |
Returns:
|
| 21 |
A Boolean mask on the sequence device, or `None` when no mask is provided.
|