Downloads · 30 days
10
2% of all-time downloads
John6666/gokaygokay-Florence-2-SD3-Captioner-8bit
gokaygokay-Florence-2-SD3-Captioner-8bit is a image-text-to-text model from John6666. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Original model is here. Tagger for local environment is here.
Downloads · 30 days
10
2% of all-time downloads
All-time downloads
456
Public
Parameters
271M
896 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors536 MB · 99%
How the weights are stored.
I8183M · 67%
From the Hugging Face model README
Original model is here. Tagger for local environment is here.
# recipe
from transformers import AutoModelForCausalLM, AutoProcessor, BitsAndBytesConfig
import transformers
import torch
import json
model_id = 'gokaygokay/Florence-2-SD3-Captioner'
save_path = 'gokaygokay-Florence-2-SD3-Captioner-8bit'
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.float32,
low_cpu_mem_usage=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0,
llm_int8_enable_fp32_cpu_offload=True,
llm_int8_skip_modules=['lm_head'],
),
)
processor.save_pretrained(save_path)
model.save_pretrained(save_path, safe_serialization=True)
config = {}
with open(f'{save_path}/config.json') as f:
config = json.load(f)
config['vision_config']['model_type'] = 'davit'
with open(f'{save_path}/config.json', 'w') as f:
json.dump(config, f, indent=2)