`gemma3_text` is not supported in mlx

#1
by dataplayer12 - opened

I created a fresh virtual env and tried running the example script provided on the model card, but it errors out

Steps to repro

python3 -m venv .mlx
. .mlx/bin/activate
python3 -m pip install mlx-embeddings
python2 script.py # from model card

Result

python3 script.py
Fetching 12 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 214177.23it/s]
ERROR:root:Model type gemma3_text not supported.
Traceback (most recent call last):
  File "/Users/Jaiyam/Documents/ml/embeddings/.mlx/lib/python3.13/site-packages/mlx_embeddings/utils.py", line 49, in _get_classes
    arch = importlib.import_module(f"mlx_embeddings.models.{model_type}")
  File "/opt/homebrew/Cellar/[email protected]/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mlx_embeddings.models.gemma3_text'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Jaiyam/Documents/ml/embeddings/script.py", line 4, in <module>
    model, tokenizer = load("mlx-community/embeddinggemma-300m-8bit")
                       ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Jaiyam/Documents/ml/embeddings/.mlx/lib/python3.13/site-packages/mlx_embeddings/utils.py", line 243, in load
    model = load_model(model_path, lazy, model_config, path_to_repo=path_or_hf_repo)
  File "/Users/Jaiyam/Documents/ml/embeddings/.mlx/lib/python3.13/site-packages/mlx_embeddings/utils.py", line 157, in load_model
    model_class, model_args_class, text_config, vision_config = get_model_classes(
                                                                ~~~~~~~~~~~~~~~~~^
        config=config
        ^^^^^^^^^^^^^
    )
    ^
  File "/Users/Jaiyam/Documents/ml/embeddings/.mlx/lib/python3.13/site-packages/mlx_embeddings/utils.py", line 53, in _get_classes
    raise ValueError(msg)
ValueError: Model type gemma3_text not supported.

Sign up or log in to comment