How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "blackhole33/Image2text"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "blackhole33/Image2text",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Use Docker
docker model run hf.co/blackhole33/Image2text
Quick Links

Model discription and Inference

Image to Text modeli bu asosan pre-trained qilingan model ustiga fine-tuned qilindi juda kam dataset bilan.

epoch soni : 50 ta

loss: 0.03....

train_time: o'rtacha 45 minute.

test

Juda ham kam dataset bilan fine-tuned qilingani uchun , ko'rsatilgan dataset imagelaridan foydalanish tafsiya qilaman.

Dataset image and uning dscription holatidan bo'ladi.

misol uchun :

    from datasets import load_dataset 
    dataset = load_dataset("ybelkada/football-dataset", split="train")

Usage model

from transformers import AutoProcessor, BlipForConditionalGeneration

processor = AutoProcessor.from_pretrained("ai-nightcoder/Image2text")
model = BlipForConditionalGeneration.from_pretrained("ai-nightcoder/Image2text")

image olamiz

example = dataset[0]
image = example["image"]
image

generate qismi.

inputs = processor(images=image, return_tensors="pt").to(device)
pixel_values = inputs.pixel_values
    
generated_ids = model.generate(pixel_values=pixel_values, max_length=50)
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_caption)

Yuqorida ko'rsatgan tartibda modeldan foydalanishni tavsiya qilaman.

Downloads last month
11
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support