Skip to content

Using Docker compose to start up Triton with the OpenClip model, to encode text in to vectors

License

Notifications You must be signed in to change notification settings

gordonmurray/openclip_triton_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using OpenClip with Triton

Using Docker compose to start up Triton with the OpenClip model, to encode text or images in to vectors

Install Nvidia toolkit

Follow the steps here: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

docker compose up --build

Test health

curl -v http://localhost:8000/v2/health/ready

Test encoding a string

curl -X POST "http://localhost:8000/v2/models/openclip_text_encoder/infer" -d '{
  "inputs": [
    {
      "name": "text_encoder_input",
      "shape": [1],
      "datatype": "BYTES",
      "data": ["hello world"]
    }
  ]
}'

Test encoding an image

The image needs to be base64 encoded first.

base64 /image.jpeg > encoded.txt

Create a JSON Payload File, because the base64 encoded string is too large to be passed directly as a command-line argument.

echo '{
  "inputs": [
    {
      "name": "image_encoder_input",
      "shape": [1],
      "datatype": "BYTES",
      "data": ["'$(cat encoded.txt)'"]
    }
  ]
}' > payload.json

Use curl to Send the Request:

curl -X POST "http://localhost:8000/v2/models/openclip_image_encoder/infer" -d @payload.json

Stats

curl -v http://localhost:8000/v2/models/stats

About

Using Docker compose to start up Triton with the OpenClip model, to encode text in to vectors

Topics

Resources

License

Stars

Watchers

Forks