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.
How to use from the
Use from the
sentence-transformers library
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]

codebert-base β€” CoreML (.mlpackage)

CoreML conversion of 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

cai 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 CI pipeline with coremltools.

pip install coremltools transformers torch
python convert.py
Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for rsvalerio/codebert-base-coreml

Quantized
(8)
this model