liquid-crow-3B

Liquid Crow adapter for LiquidAI/LFM2.5-VL-3B.

Use with Transformers

pip install -U transformers peft accelerate torch
import torch
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor

base_id = "LiquidAI/LFM2.5-VL-3B"
adapter_id = "lucas-vitrus/liquid-crow-3B"

processor = AutoProcessor.from_pretrained(base_id)
base = AutoModelForImageTextToText.from_pretrained(
    base_id,
    torch_dtype=torch.float16,
    device_map="auto",
)
model = PeftModel.from_pretrained(base, adapter_id).eval()

messages = [
    {
        "role": "user",
        "content": [{"type": "text", "text": "What is a calibration trace?"}],
    }
]
inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device)

with torch.inference_mode():
    output = model.generate(**inputs, max_new_tokens=128, do_sample=False)

answer = processor.batch_decode(
    output[:, inputs["input_ids"].shape[1]:],
    skip_special_tokens=True,
)[0]
print(answer)

Use with an image

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://example.com/image.jpg"},
            {"type": "text", "text": "Describe the image."},
        ],
    }
]

Use the same apply_chat_template and generation steps shown above.

This repository contains a PEFT adapter. Load it together with the base model.

Downloads last month
12
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lucas-vitrus/liquid-crow-3B

Adapter
(1)
this model