vidore/colpali_train_set
Viewer • Updated • 119k • 9.79k • 91
How to use thoddnn/colqwen2-v1.0-mlx-4bit with Transformers:
# Load model directly
from transformers import AutoProcessor, AutoModelForPreTraining
processor = AutoProcessor.from_pretrained("thoddnn/colqwen2-v1.0-mlx-4bit")
model = AutoModelForPreTraining.from_pretrained("thoddnn/colqwen2-v1.0-mlx-4bit")How to use thoddnn/colqwen2-v1.0-mlx-4bit with ColPali:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
How to use thoddnn/colqwen2-v1.0-mlx-4bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir colqwen2-v1.0-mlx-4bit thoddnn/colqwen2-v1.0-mlx-4bit
The Model thoddnn/colqwen2-v1.0-mlx-4bit was converted to MLX format from vidore/colqwen2-v1.0-hf using mlx-lm version 0.0.3.
pip install mlx-embeddings
from mlx_embeddings import load, generate
import mlx.core as mx
model, tokenizer = load("thoddnn/colqwen2-v1.0-mlx-4bit")
# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds # Normalized embeddings
# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)
print("Similarity matrix between texts:")
print(similarity_matrix)
Quantized