Instructions to use KoalaAI/Text-Moderation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KoalaAI/Text-Moderation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KoalaAI/Text-Moderation")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KoalaAI/Text-Moderation") model = AutoModelForSequenceClassification.from_pretrained("KoalaAI/Text-Moderation") - Inference
- Notebooks
- Google Colab
- Kaggle
Launching this into production
#3
by anujn - opened
Firstly thank you for this awesome classifier.
I would like to launch it to a dedicated endpoint. Is it currently hosted on GPU or CPU.
Also how can we return the multi-label classification's.
We have tried using HF's deploy method on GPU.
It's quick but only wants to return a single classification.
Any guidence here would be much appreciated.
anujn changed discussion status to closed
Sorry figured it out:
"return_all_scores": True
Glad you got it sorted! :)