Run this model with HF Jobs
Run rsvalerio/codebert-base-coreml on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/rsvalerio/codebert-base-coreml. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/rsvalerio/codebert-base-coreml on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use rsvalerio/codebert-base-coreml with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use rsvalerio/codebert-base-coreml with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("rsvalerio/codebert-base-coreml") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update model card
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748---license: mittags: - coreml - sentence-transformers - embedding - code - robertabase_model: microsoft/codebert-baselibrary_name: coremltoolspipeline_tag: feature-extraction---
# codebert-base — CoreML (.mlpackage)
CoreML conversion of [microsoft/codebert-base](https://huggingface.co/microsoft/codebert-base) for native Apple Neural Engine / GPU inference on macOS and iOS.
## Files
| File | Description ||------|-------------|| `model.mlpackage/` | CoreML model (FP16, flexible shapes) || `tokenizer.json` | HF fast tokenizer |
## Details
- **Architecture**: RoBERTa (encoder-only, no token_type_ids)- **Precision**: FP16 (native ANE precision)- **Compute units**: `.all` — CoreML schedules across ANE, GPU, and CPU- **Input shapes**: batch=1..512, seq_len=1..512 (flexible range)- **Embedding dimension**: 768
## Usage with cai
```bashcai index --embed-backend swift --embed-model "rsvalerio/codebert-base-coreml"```
The Swift backend downloads the `.mlpackage` from this repo, compiles it to `.mlmodelc` on first run (~30-60s), and caches the compiled model for subsequent runs.
## Conversion
Converted using [rsvalerio/models](https://github.com/rsvalerio/models) CI pipeline with `coremltools`.
```bashpip install coremltools transformers torchpython convert.py```README.mdAdded+48