andriadze/pic-text-requests-synth
Viewer • Updated • 27k • 7
How to use andriadze/text-pic-request-identifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="andriadze/text-pic-request-identifier") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("andriadze/text-pic-request-identifier")
model = AutoModelForSequenceClassification.from_pretrained("andriadze/text-pic-request-identifier")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("andriadze/text-pic-request-identifier")
model = AutoModelForSequenceClassification.from_pretrained("andriadze/text-pic-request-identifier")This model is a fine-tuned version of distilbert/distilbert-base-uncased on an synthetic dataset.
It achieves the following results on the evaluation set:
Model identifies if user is asking for a picture or a text.
Intended use for chat applications to either route the message to a text model or an image model.
Model will return 'pic' or 'text'
Model was trained on synthetic dataset consisting of around ~25k messages. Messages were generated by different LLM's including gpt4,gpt4o,gpt4o-mini,gpt3.5-turbo
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.0391 | 1.0 | 844 | 0.0021 | 0.9996 |
| 0.0021 | 2.0 | 1688 | 0.0015 | 0.9996 |
from transformers import (
pipeline
)
picClassifier = pipeline("text-classification", model="andriadze/text-pic-request-identifier")
res = picClassifier('Can you send me a selfie?')
Base model
distilbert/distilbert-base-uncased
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="andriadze/text-pic-request-identifier")