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.

Serverless API

#1
by alexanderniebuhr - opened

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)}

we are working on support in infinity: https://github.com/michaelfeil/infinity/pull/568

https://github.com/athrael-soju/fastapi-nextjs-colpali-template

The colpali folder is a standalong Colpali server running colqwen-0.2 as a standalone.

Sign up or log in to comment