Downloads · 30 days
0
LHPKAI/final-model-all-datasets-EP3
final-model-all-datasets-EP3 is a machine learning model from LHPKAI. 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 top of Qwen/Qwen3-VL-8B-Instruct.
Downloads · 30 days
0
Access
Public
Updated Nov 20, 2025
Parameters
8.8B
17.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors17.5 GB · 100%
From the Hugging Face model README
This is a LoRA adapter fine-tuned on top of Qwen/Qwen3-VL-8B-Instruct.
This model is a fine-tuned version of Qwen3-VL-8B-Instruct using LoRA (Low-Rank Adaptation) for efficient training. The adapter weights can be merged with the base model for inference.
pip install transformers peft torch pillow qwen-vl-utils
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from peft import PeftModel
import torch
# Load base model
base_model = Qwen2VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen3-VL-8B-Instruct",
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
base_model,
"openhay/qwen3vl-8b-lora",
torch_dtype=torch.bfloat16
)
# Load processor
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct")
from qwen_vl_utils import process_vision_info
from PIL import Image
# Prepare messages
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": "path/to/image.jpg"},
{"type": "text", "text": "Describe this image in detail."},
],
}
]
# Prepare for inference
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
)
inputs = inputs.to("cuda")
# Generate
with torch.no_grad():
generated_ids = model.generate(**inputs, max_new_tokens=512)
generated_ids_trimmed = [
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed,
skip_special_tokens=True,
clean_up_tokenization_spaces=False
)
print(output_text[0])
If you want to merge the LoRA weights into the base model for faster inference:
from transformers import Qwen2VLForConditionalGeneration
from peft import PeftModel
# Load base model and adapter
base_model = Qwen2VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen3-VL-8B-Instruct",
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, "openhay/qwen3vl-8b-lora")
# Merge and save
merged_model = model.merge_and_unload()
merged_model.save_pretrained("./merged_model")
If you use this model, please cite:
@misc{qwen3vl_8b_lora,
author = {OpenHay},
title = {qwen3vl-8b-lora},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/openhay/qwen3vl-8b-lora}}
}