From fbdd8b5871f1a97c5d4991efc5b193e900a59f30 Mon Sep 17 00:00:00 2001 From: Shuai Shao Date: Thu, 2 Jan 2025 15:23:59 -0800 Subject: [PATCH] import PIL on demand --- all_models/inflight_batcher_llm/preprocessing/1/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all_models/inflight_batcher_llm/preprocessing/1/model.py b/all_models/inflight_batcher_llm/preprocessing/1/model.py index f48efe4..c141896 100755 --- a/all_models/inflight_batcher_llm/preprocessing/1/model.py +++ b/all_models/inflight_batcher_llm/preprocessing/1/model.py @@ -33,7 +33,6 @@ import numpy as np import requests import triton_python_backend_utils as pb_utils -from PIL import Image from transformers import AutoProcessor, AutoTokenizer, T5Tokenizer @@ -754,6 +753,7 @@ def str_dtype_to_torch(dtype): self.vision_model_type = vision_model_type def load_images_from_urls(self, img_urls): + from PIL import Image images = [] for img_url in img_urls: img_url = img_url.decode()