Downloads · 30 days
2
10% of all-time downloads
lucas-vitrus/liquid-crow-3B
liquid-crow-3B is a machine learning model from lucas-vitrus. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
Liquid Crow adapter for LiquidAI/LFM2.5-VL-3B.
Downloads · 30 days
2
10% of all-time downloads
All-time downloads
20
Public
Repo size
36.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors18.4 MB · 51%
From the Hugging Face model README
Liquid Crow adapter for LiquidAI/LFM2.5-VL-3B.
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)
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.