Instructions to use KRLabsOrg/lettucedect-base-modernbert-en-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KRLabsOrg/lettucedect-base-modernbert-en-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="KRLabsOrg/lettucedect-base-modernbert-en-v1")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("KRLabsOrg/lettucedect-base-modernbert-en-v1") model = AutoModelForTokenClassification.from_pretrained("KRLabsOrg/lettucedect-base-modernbert-en-v1") - Inference
- Notebooks
- Google Colab
- Kaggle
Warnings running on macOS on a M3 Max
Hi, thanks for the model :-)
When I run the sample on my Mac, I get the following output.
What do these warnings mean and does the 'Falling back to non-compiled mode' impact performance?
❯ python lettucedetect_test.py
/Users/abc/miniconda3/envs/lettucedetect/lib/python3.11/site-packages/lettucedetect/models/inference.py:85: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
labels = torch.tensor(labels, device=self.device)
Compiling the model with torch.compile and using a torch.cpu device is not supported. Falling back to non-compiled mode.
Predictions: [{'start': 31, 'end': 71, 'confidence': 0.9891982674598694, 'text': ' The population of France is 69 million.'}]