ayoubkirouane/One-Piece-anime-captions
Viewer • Updated • 856 • 102 • 1
How to use ayoubkirouane/git-base-One-Piece with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "image-to-text" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("image-to-text", model="ayoubkirouane/git-base-One-Piece") # Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("ayoubkirouane/git-base-One-Piece")
model = AutoModelForImageTextToText.from_pretrained("ayoubkirouane/git-base-One-Piece")Git-base-One-Piece is a fine-tuned variant of Microsoft's git-base model, specifically trained for the task of generating descriptive text captions for images from the One-Piece-anime-captions dataset.
The dataset consists of 856 {image: caption} pairs, providing a substantial and diverse training corpus for the model.
The model is conditioned on both CLIP image tokens and text tokens and employs a teacher forcing training approach. It predicts the next text token while considering the context provided by the image and previous text tokens.
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-to-text", model="ayoubkirouane/git-base-One-Piece")
or
# Load model directly
from transformers import AutoProcessor, AutoModelForCausalLM
processor = AutoProcessor.from_pretrained("ayoubkirouane/git-base-One-Piece")
model = AutoModelForCausalLM.from_pretrained("ayoubkirouane/git-base-One-Piece")