Update README.md
Browse files
README.md
CHANGED
@@ -148,8 +148,19 @@ The model was trained with the following hyperparameters:
|
|
148 |
|
149 |
This model is compatible with VLLM and inference engines, which can significantly improve inference speed, especially for batch processing. When using the model, be sure to use the ModernBERT tokenizer and respect the model's maximum sequence length of 8192 tokens.
|
150 |
|
|
|
|
|
151 |
Example usage:
|
152 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
154 |
import torch
|
155 |
|
|
|
148 |
|
149 |
This model is compatible with VLLM and inference engines, which can significantly improve inference speed, especially for batch processing. When using the model, be sure to use the ModernBERT tokenizer and respect the model's maximum sequence length of 8192 tokens.
|
150 |
|
151 |
+
|
152 |
+
|
153 |
Example usage:
|
154 |
```python
|
155 |
+
# via pipeline
|
156 |
+
|
157 |
+
# Use a pipeline as a high-level helper
|
158 |
+
from transformers import pipeline
|
159 |
+
|
160 |
+
pipe = pipeline("text-classification", model="davanstrien/modernbert-topics-1m")
|
161 |
+
|
162 |
+
# direct use
|
163 |
+
|
164 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
165 |
import torch
|
166 |
|