Downloads · 30 days
7
10% of all-time downloads
TanVir17Niloy/blip-hypermodulator-v1
blip-hypermodulator-v1 is a machine learning model from TanVir17Niloy. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
An enhanced hypernetwork that generates LoRA adapters for BLIP image captioning models based on natural language task descriptions.
Downloads · 30 days
7
10% of all-time downloads
All-time downloads
67
Public
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.bin1 GB · 100%
From the Hugging Face model README
An enhanced hypernetwork that generates LoRA adapters for BLIP image captioning models based on natural language task descriptions.
This model is a sophisticated hypernetwork that can generate task-specific LoRA (Low-Rank Adaptation) weights for BLIP image captioning models. Given a natural language description of a desired captioning style or task, it generates appropriate LoRA adapters to modify the BLIP model's behavior.
from transformers import BlipForConditionalGeneration, BlipProcessor
from blip_hyper_modulator import BlipHyperModulator
from sentence_transformers import SentenceTransformer
# Load base BLIP model
blip_model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large")
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
# Load hypermodulator
hypermodulator = BlipHyperModulator.from_pretrained("path/to/model", blip_model)
# Load text encoder
text_encoder = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
# Generate LoRA weights
lora_weights = hypermodulator.generate_lora_weights(
task_description="Describe this image like a pirate would",
text_encoder=text_encoder,
text_tokenizer=None
)
If you use this model, please cite:
@misc{blip-hypermodulator,
title={BLIP HyperModulator: Dynamic LoRA Generation for Image Captioning},
author={Your Name},
year={2024},
url={https://huggingface.co/TanVir17Niloy/blip-hypermodulator-v1}
}