Bug / Issue while importing the model

#1
by LLdevModel - opened

I was trying to write the code provided from in the description, but there is no hf_llm subfolder in mlx-examples now, so I used https://github.com/ml-explore/mlx-lm repo with its mlx_lm.generate.py script instead. When running the code the following error pops-up:

ERROR:root:Model type xlm-roberta not supported.
Traceback (most recent call last):
  File ".../mlx-lm/mlx_lm/utils.py", line 148, in _get_classes
    arch = importlib.import_module(f"mlx_lm.models.{model_type}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mlx_lm.models.xlm-roberta'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File ".../mlx-lm/mlx_lm/generate.py", line 287, in <module>
    main()
  File ".../mlx-lm/mlx_lm/generate.py", line 207, in main
    model, tokenizer = load(
                       ^^^^^
  File ".../mlx-lm/mlx_lm/utils.py", line 785, in load
    model, config = load_model(model_path, lazy)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../mlx-lm/mlx_lm/utils.py", line 720, in load_model
    model_class, model_args_class = get_model_classes(config=config)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../mlx-lm/mlx_lm/utils.py", line 152, in _get_classes
    raise ValueError(msg)
ValueError: Model type xlm-roberta not supported.

The code I ran was:

python -m mlx_lm.generate --model .../multilingual-e5-large-mlx --prompt "query: This is a new text"
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment