Text Classification
Transformers
PyTorch
TensorBoard
bert
Generated from Trainer
text-embeddings-inference
Instructions to use HCKLab/BiBert-MultiTask-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HCKLab/BiBert-MultiTask-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="HCKLab/BiBert-MultiTask-2", device_map="auto")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("HCKLab/BiBert-MultiTask-2") model = AutoModelForSequenceClassification.from_pretrained("HCKLab/BiBert-MultiTask-2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
add custom handler and modify pipeline
Browse files- __pycache__/handler.cpython-37.pyc +0 -0
- handler.py +1 -1
__pycache__/handler.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/handler.cpython-37.pyc and b/__pycache__/handler.cpython-37.pyc differ
|
|
|
handler.py
CHANGED
|
@@ -61,7 +61,7 @@ class EndpointHandler():
|
|
| 61 |
|
| 62 |
if label == '0' and score >= 0.75:
|
| 63 |
label = 2
|
| 64 |
-
return {"label":label, "score": score}
|
| 65 |
else:
|
| 66 |
prediction_s = self.classifier_s(inputs)
|
| 67 |
label = prediction_s[0]['label']
|
|
|
|
| 61 |
|
| 62 |
if label == '0' and score >= 0.75:
|
| 63 |
label = 2
|
| 64 |
+
return [{"label":label, "score": score}]
|
| 65 |
else:
|
| 66 |
prediction_s = self.classifier_s(inputs)
|
| 67 |
label = prediction_s[0]['label']
|