Spaces:
Sleeping
Sleeping
Update src/modernbert/classifier.py
Browse files
src/modernbert/classifier.py
CHANGED
|
@@ -15,7 +15,6 @@ classifier = pipeline(
|
|
| 15 |
"zero-shot-classification",
|
| 16 |
model="MoritzLaurer/ModernBERT-large-zeroshot-v2.0",
|
| 17 |
torch_dtype=torch.bfloat16,
|
| 18 |
-
device="cpu"
|
| 19 |
)
|
| 20 |
|
| 21 |
|
|
@@ -23,7 +22,7 @@ def ZeroShotTextClassification(
|
|
| 23 |
text_input: str, candidate_labels: str, multi_label: bool
|
| 24 |
) -> Dict[str, float]:
|
| 25 |
"""
|
| 26 |
-
Performs zero-shot classification on the given text input.
|
| 27 |
|
| 28 |
Args:
|
| 29 |
- text_input: The input text to classify.
|
|
|
|
| 15 |
"zero-shot-classification",
|
| 16 |
model="MoritzLaurer/ModernBERT-large-zeroshot-v2.0",
|
| 17 |
torch_dtype=torch.bfloat16,
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
|
|
|
|
| 22 |
text_input: str, candidate_labels: str, multi_label: bool
|
| 23 |
) -> Dict[str, float]:
|
| 24 |
"""
|
| 25 |
+
Performs zero-shot classification on the given text input and candidate labels.
|
| 26 |
|
| 27 |
Args:
|
| 28 |
- text_input: The input text to classify.
|