Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLX example? #31

Open
maxlund opened this issue Jan 26, 2025 · 0 comments
Open

MLX example? #31

maxlund opened this issue Jan 26, 2025 · 0 comments

Comments

@maxlund
Copy link

maxlund commented Jan 26, 2025

Hi, wanted to do some quick tests using aimv2-large-patch14-224-lit with the MLX backend but can't seem to find any convenience function to encode text in the repo? Digging through the code for a little while now and not seeing anything like the image encoding example using MLX:

from PIL import Image
import mlx.core as mx

from aim.v2.utils import load_pretrained
from aim.v1.torch.data import val_transforms

img = Image.open(...)
model = load_pretrained("aimv2-large-patch14-336", backend="mlx")
transform = val_transforms(img_size=336)

inp = transform(img).unsqueeze(0)
inp = mx.array(inp.numpy())
features = model(inp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant