Downloads · 30 days
6
7% of all-time downloads
plouryNV/gemma3-4b-cord-v2-peft
gemma3-4b-cord-v2-peft is a machine learning model from plouryNV. 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 apache-2.0.
This is a LoRA adapter fine-tuned on the naver-clova-ix/cord-v2 dataset for document understanding tasks (receipt parsing).
Downloads · 30 days
6
7% of all-time downloads
All-time downloads
87
Public
Repo size
97.8 MB
Likes
0
Public
Click a slice to open those files.
.json34.6 MB · 50%
From the Hugging Face model README
This is a LoRA adapter fine-tuned on the naver-clova-ix/cord-v2 dataset for document understanding tasks (receipt parsing).
from nemo_automodel._transformers import NeMoAutoModelForImageTextToText
from nemo_automodel._peft.lora import PeftConfig, apply_lora_to_linear_modules
from transformers import AutoProcessor
from safetensors.torch import load_file
import torch
import json
# Load base model
model = NeMoAutoModelForImageTextToText.from_pretrained(
"google/gemma-3-4b-it",
torch_dtype=torch.bfloat16,
).to("cuda")
# Load and apply LoRA adapter
adapter_path = "path/to/downloaded/adapter"
with open(f"{adapter_path}/adapter_config.json") as f:
config = json.load(f)
peft_config = PeftConfig(dim=config["r"], alpha=config["lora_alpha"])
apply_lora_to_linear_modules(model, peft_config)
# Load adapter weights
adapter_weights = load_file(f"{adapter_path}/adapter_model.safetensors")
model.load_state_dict(adapter_weights, strict=False)
# Run inference
processor = AutoProcessor.from_pretrained("google/gemma-3-4b-it")
# ... use model for inference
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor
base_model = AutoModelForImageTextToText.from_pretrained("google/gemma-3-4b-it")
model = PeftModel.from_pretrained(base_model, "plouryNV/gemma3-4b-cord-v2-peft")
processor = AutoProcessor.from_pretrained("google/gemma-3-4b-it")
This adapter was trained using the NeMo AutoModel framework with the following configuration:
adapter_model.safetensors - LoRA adapter weightsadapter_config.json - HuggingFace PEFT-compatible configautomodel_peft_config.json - NeMo AutoModel PEFT configApache 2.0