Buckets:

download
raw
559 Bytes
"""BLIP model tests and benchmarks."""
import pytest
from nos.models import BLIP
from nos.test.utils import NOS_TEST_IMAGE, skip_if_no_torch_cuda
@pytest.fixture(scope="module")
def model():
MODEL_NAME = "Salesforce/blip-image-captioning-large"
yield BLIP(model_name=MODEL_NAME)
@skip_if_no_torch_cuda
def test_blip_caption(model):
from PIL import Image
im = Image.open(NOS_TEST_IMAGE)
caption = model(im)
assert caption is not None
vqa_answer = model(im, prompt="What's in this picture?")
assert vqa_answer is not None

Xet Storage Details

Size:
559 Bytes
·
Xet hash:
7731bf5d83aca24b38d4f1f250976c45d43e6ee97229d47bd37e256ed039843b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.