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
Download tests/test_vision.py from larkooo/gemma-e2b-rlcd: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/larkooo/gemma-e2b-rlcd/resolve/main/tests/test_vision.py
- Command line
-
hf download hf://larkooo/gemma-e2b-rlcd/tests/test_vision.py
-
curl -L -o test_vision.py https://huggingface.co/larkooo/gemma-e2b-rlcd/resolve/main/tests/test_vision.py
1.18 kB
| import pytest | |
| mx = pytest.importorskip("mlx.core") | |
| vision = pytest.importorskip("gemma_rlcd.vision") | |
| config_module = pytest.importorskip("mlx_vlm.models.gemma4.config") | |
| def test_indexed_positions_match_dense_lookup_including_padding(dtype): | |
| config = config_module.VisionConfig(hidden_size=8, position_embedding_size=16) | |
| original = vision.VisionPatchEmbedder(config) | |
| original.position_embedding_table = mx.random.normal((2, 16, 8)).astype(dtype) | |
| indexed = vision.IndexedVisionPatchEmbedder(original) | |
| positions = mx.array([[[2, 3], [0, 0], [-1, -1], [16, 2], [4, 5]]]) | |
| padding = mx.array([[False, False, True, False, True]]) | |
| expected = original._position_embeddings(positions, padding) | |
| actual = indexed._position_embeddings(positions, padding) | |
| # The M5 dense float32 matmul can round table entries internally; gather | |
| # returns their stored values directly. Half/bfloat paths match exactly. | |
| if dtype == mx.float32: | |
| assert bool(mx.allclose(actual, expected, atol=2e-3, rtol=2e-3).item()) | |
| else: | |
| assert bool(mx.array_equal(actual, expected).item()) | |