Run this model with HF Jobs
Run apple/CLaRa-7B-Instruct 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/apple/CLaRa-7B-Instruct. 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/apple/CLaRa-7B-Instruct 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 apple/CLaRa-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use apple/CLaRa-7B-Instruct with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("apple/CLaRa-7B-Instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoning
CLaRa-7B-Instruct (Compression-16 & 128)
The CLaRa-7B-Instruct model is our instruction-tuned unified RAG model with built-in semantic document compression (16Γ & 128x).
It supports instruction-following QA directly from compressed document representations.
Training recipe: Instruction tuning on QA-style tasks built on top of the base semantic compression model.
Benchmarks: Strong instruction-following performance under 16Γ compression.
More details and usage examples:
Paper: CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoning
GitHub: https://github.com/apple/ml-clara
Video (from @Fahd Mirza): https://youtu.be/al2VoAKn8GU?si=Q8bq7QNMaTvcArwa
Example Usage (Instruction-Tuned Inference)
from transformers import AutoModel
unirag = AutoModel.from_pretrained(
"/mnt/ceph_rbd/model/CLaRa-7B-Instruct/compression-16",
trust_remote_code=True
).to("cuda")
documents = [
[
"Weldenia is a monotypic genus of flowering plant in the family Commelinaceae...",
"Hagsatera is a genus of flowering plants from the orchid family...",
"Alsobia is a genus of flowering plants in the family Gesneriaceae..."
]
]
questions = [
"Which genus of plant grows originally in Mexico and Guatemala, Phylica or Weldenia?"
]
# Instruction-tuned usage
out = unirag.generate_from_text(
questions=questions,
documents=documents,
max_new_tokens=64
)
print("Generated answer:", out)
Model tree for apple/CLaRa-7B-Instruct
Base model
mistralai/Mistral-7B-Instruct-v0.2