Skip to content

Commit

Permalink
remove image (nod-ai#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-garvey authored Mar 20, 2024
1 parent f2c025c commit 36a7091
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from transformers import CLIPTokenizer
from iree import runtime as ireert
import torch
from PIL import Image

parser = argparse.ArgumentParser()

Expand Down Expand Up @@ -70,12 +69,9 @@ def run_clip(
from transformers import CLIPProcessor
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
tokenizer = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
text_input = tokenizer(
text=prompt,
images=image,
truncation=True,
padding=True,
return_tensors="pt",
Expand Down Expand Up @@ -122,10 +118,6 @@ def run_torch_clip(hf_model_name, hf_auth_token, prompt):
else:
if hf_model_name == "openai/clip-vit-large-patch14":
from transformers import CLIPProcessor
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

tokenizer = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
hf_subfolder = "" # CLIPProcessor does not have a subfolder
Expand All @@ -138,7 +130,6 @@ def run_torch_clip(hf_model_name, hf_auth_token, prompt):
)
text_input = tokenizer(
text=prompt,
images=image,
truncation=True,
padding=True,
return_tensors="pt",
Expand Down

0 comments on commit 36a7091

Please sign in to comment.