Run this model with HF Jobs
Run vidore/colqwen2.5-v0.2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/vidore/colqwen2.5-v0.2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/vidore/colqwen2.5-v0.2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use vidore/colqwen2.5-v0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ColPali
How to use vidore/colqwen2.5-v0.2 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
- sentence-transformers
How to use vidore/colqwen2.5-v0.2 with sentence-transformers:
from sentence_transformers import MultiVectorEncoder model = MultiVectorEncoder("vidore/colqwen2.5-v0.2") queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
Serverless API
I'm trying to understand how to deploy this as an serverless API, so I can submit an image as an Input and receive the embeddings as an Output. Could you help with that?
For example, using a function that you can deploy via, say, FastAPI, or some serverless setup. This just creates embeddings for the specified page, and returns that as a JSON string:
images: list[Image.Image] = convert_from_bytes(pdf_data, dpi=300, first_page=page_number, last_page=page_number)
image = images[0]
embeddings = generate_embeddings(colqwen2_model, colqwen2_processor.process_images([image]))[0]
page_embeddings = [binary_quantize(e) for e in embeddings]
embeddings_list = [e.to_text() for e in page_embeddings]
return {"embeddings": json.dumps(embeddings_list)}
https://github.com/athrael-soju/fastapi-nextjs-colpali-template
The colpali folder is a standalong Colpali server running colqwen-0.2 as a standalone.