Run this model with HF Jobs
Run radames/blip_image_embeddings on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/radames/blip_image_embeddings. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/radames/blip_image_embeddings on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use radames/blip_image_embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use radames/blip_image_embeddings with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="radames/blip_image_embeddings")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("radames/blip_image_embeddings", device_map="auto") - Notebooks
- Google Colab
- Kaggle
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("radames/blip_image_embeddings", device_map="auto")Quick Links
Fork of salesforce/BLIP for a feature-extraction task on 🤗Inference endpoint.
This repository implements a custom task for feature-extraction for 🤗 Inference Endpoints. The code for the customized pipeline is in the pipeline.py.
To use deploy this model a an Inference Endpoint you have to select Custom as task to use the pipeline.py file. -> double check if it is selected
expected Request payload
{
"inputs": "/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAMCAgICAgMC....", // base64 image as bytes
}
below is an example on how to run a request using Python and requests.
Run Request
- prepare an image.
!wget https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
2.run request
import json
from typing import List
import requests as r
import base64
ENDPOINT_URL = "https://api-inference.huggingface.co/models/radames/blip_image_embeddings"
HF_TOKEN = ""
def predict(path_to_image: str = None):
with open(path_to_image, "rb") as i:
b64 = base64.b64encode(i.read())
payload = {"inputs": b64.decode("utf-8")}
response = r.post(
ENDPOINT_URL, headers={"X-Wait-For-Model": "true", "Authorization": f"Bearer {HF_TOKEN}"}, json=payload
)
return response.json()
prediction = predict(
path_to_image="palace.jpg"
)
expected output
[0.016450975090265274,
-0.5551009774208069,
0.39800673723220825,
-0.6809228658676147,
2.053842782974243,
-0.4712907075881958,...]
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="radames/blip_image_embeddings")