Instructions to use blancsw/lang-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use blancsw/lang-detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="blancsw/lang-detection")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("blancsw/lang-detection") model = AutoModelForSequenceClassification.from_pretrained("blancsw/lang-detection") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -33,4 +33,4 @@ class EndpointHandler:
|
|
| 33 |
else:
|
| 34 |
prediction = self.pipline(inputs)
|
| 35 |
# postprocess the prediction
|
| 36 |
-
return prediction
|
|
|
|
| 33 |
else:
|
| 34 |
prediction = self.pipline(inputs)
|
| 35 |
# postprocess the prediction
|
| 36 |
+
return [{"label": p["label"]} for p in prediction]
|