Downloads · 30 days
11
30% of all-time downloads
Khabner/florence-base-lora-v1
florence-base-lora-v1 is a machine learning model from Khabner. 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 mit.
PEFT LoRA adapter for Florence-2-base-ft (refs/pr/6) fine-tuned for UI click localization via the <CAPTIONTOPHRASEGROUNDING task. Coordinates returned as <locN tokens (normalized via /999).
Downloads · 30 days
11
30% of all-time downloads
All-time downloads
37
Public
Repo size
7.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors7.1 MB · 57%
From the Hugging Face model README
PEFT LoRA adapter for Florence-2-base-ft (refs/pr/6) fine-tuned for UI click localization via the <CAPTION_TO_PHRASE_GROUNDING> task. Coordinates returned as <loc_N> tokens (normalized via /999).
Khabner/florence-base-lora-v22.import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoProcessor
base = AutoModelForCausalLM.from_pretrained(
"microsoft/Florence-2-base-ft", trust_remote_code=True, revision="refs/pr/6",
)
processor = AutoProcessor.from_pretrained(
"microsoft/Florence-2-base-ft", trust_remote_code=True, revision="refs/pr/6",
)
model = PeftModel.from_pretrained(base, "Khabner/florence-base-lora-v1").eval()
prompt = "<CAPTION_TO_PHRASE_GROUNDING>Send button"
inputs = processor(text=prompt, images=image, return_tensors="pt")
generated = model.generate(**inputs, max_new_tokens=50, num_beams=1, do_sample=False)
text = processor.batch_decode(generated, skip_special_tokens=False)[0]
# Parse <loc_X><loc_Y> from `text`, divide by 999 → normalized coords
Full reference inference and FastAPI serving code: github.com/VLM-WEBTEST/magnitude_integration.