Instructions to use baseten/gemma-4-e2b-it-sequence-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baseten/gemma-4-e2b-it-sequence-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="baseten/gemma-4-e2b-it-sequence-classification", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForSequenceClassification processor = AutoProcessor.from_pretrained("baseten/gemma-4-e2b-it-sequence-classification", trust_remote_code=True) model = AutoModelForSequenceClassification.from_pretrained("baseten/gemma-4-e2b-it-sequence-classification", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
File size: 848 Bytes
4dd975e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ---
base_model: google/gemma-4-E2B-it
library_name: transformers
pipeline_tag: text-classification
tags:
- gemma4
- sequence-classification
- text-classification
---
# Gemma 4 E2B IT Sequence Classification
This checkpoint converts `google/gemma-4-E2B-it` into a two-label sequence
classifier by slicing the original LM head to the single-token labels `no` and
`yes`.
The classifier logits are exactly the original next-token logits for:
- `no`: token id `1904`
- `yes`: token id `4443`
Load with custom code enabled:
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "baseten/gemma-4-e2b-it-sequence-classification"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(
model_id,
trust_remote_code=True,
dtype="auto",
)
```
|