How to run this model from within MLX Studio

#1
by Deviad - opened

Hi all,
to make it work I went through different steps.

Since with normal: uv tool install vmlx
and with
uv tool install vmlx --with "jang[mlx]" --force --python /Users/foobar/.local/share/uv/tools/vmlx/bin/python
I was having errors,
[19:03:24.490] RuntimeError: JANGTQ VLM requires jang_tools.load_jangtq_vlm but import failed: No module named 'jang_tools.load_jangtq_vlm'

Also, this one
uv tool install vmlx --with "jang[mlx] @ git+https://github.com/jjang-ai/jangq#subdirectory=jang-tools" --with torchvision --with torch --force --python /Applications/vMLX.app/Contents/Resources/bundled-python/python/bin/python3

Would produce:
[01:18:24.443] File "/Users/foobar/.local/share/uv/tools/vmlx/lib/python3.12/site-packages/jang_tools/load_jangtq.py", line 47, in
[01:18:24.443] from jang_tools.turboquant.tq_kernel import TurboQuantLinear, TurboQuantSwitchLinear
[01:18:24.443] ModuleNotFoundError: No module named 'jang_tools.turboquant.tq_kernel'

I finally found the winning combination.
uv tool install vmlx --with "jang[mlx] @ git+https://github.com/jjang-ai/jangq#subdirectory=jang-tools" --with torchvision --with torch --force --python /Applications/vMLX.app/Contents/Resources/bundled-python/python/bin/python3

Then create and execute this script:
#!/usr/bin/env zsh
VMLX_SITE=/Users/foobar/.local/share/uv/tools/vmlx/lib/python3.12/site-packages
MLXSTUDIO_JT=/Applications/vMLX.app/Contents/Resources/bundled-python/python/lib/python3.12/site-packages/jang_tools
rm -rf "$VMLX_SITE/jang_tools"
ln -s "$MLXSTUDIO_JT" "$VMLX_SITE/jang_tools"

Long story short, you must use the same jang-tools version inside Vmlx studio because there is something which is not published yet in the public repos of jang_tools or a command which I dunno and that is not automatically executed by vmlx studio for installation.

image

Sign up or log in to comment