Any-to-Any
MLX
Safetensors
gemma4
mlx-vlm
rlcd
multimodal
classification
parallel-inference
image-text-to-text
audio
video
4-bit precision
Instructions to use larkooo/gemma-e2b-rlcd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use larkooo/gemma-e2b-rlcd with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download larkooo/gemma-e2b-rlcd --local-dir gemma-e2b-rlcd
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 1,476 Bytes
53e24ca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import json
import pytest
from gemma_rlcd.cached_backend import CachedMLXBackend
from gemma_rlcd.catalog_backend import CatalogMLXBackend
from gemma_rlcd.core import ScoringRequest, State
def test_catalog_retains_complete_descriptions_and_uses_short_selectors(monkeypatch):
backend = CatalogMLXBackend.__new__(CatalogMLXBackend)
backend.branch_batch_size = 8
requests = [
ScoringRequest(
"original",
("A", "B"),
"Question\nwith detail",
(("yes", "First\nsecond line"), ("no", "No")),
)
]
captured = {}
def prepare(self, state, selectors):
captured["catalog"] = json.loads(self._catalog)
captured["selectors"] = selectors
return "prepared"
monkeypatch.setattr(CachedMLXBackend, "prepare", prepare)
assert backend.prepare(State(text="evidence"), requests) == "prepared"
assert captured["catalog"][0]["question"] == "Question\nwith detail"
assert captured["catalog"][0]["options"][0]["meaning"] == "First\nsecond line"
assert captured["selectors"][0].prompt == "Evaluate field 0. Answer code:"
assert backend._catalog is None
def test_catalog_rejects_overflow_instead_of_serializing_fields():
backend = CatalogMLXBackend.__new__(CatalogMLXBackend)
backend.branch_batch_size = 1
with pytest.raises(ValueError, match="one branch batch"):
backend.prepare(State(text="evidence"), [ScoringRequest("x", ("A", "B"))] * 2)
|