-
Notifications
You must be signed in to change notification settings - Fork 818
Open
Description
Getting FileNotFound error when trying to load processor. For this file in particular "bpe_simple_vocab_16e6.txt.gz"
This is my patch :P
try:
self.model = build_sam3_image_model()
self.processor = Sam3Processor(self.model)
except FileNotFoundError:
response = requests.get("https://github.com/openai/CLIP/raw/refs/heads/main/clip/bpe_simple_vocab_16e6.txt.gz", stream=True) # Use stream=True for large files
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
# 3. Write the content to the local file
with open('/usr/local/lib/python3.12/dist-packages/assets/bpe_simple_vocab_16e6.txt.gz', 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
self.model = build_sam3_image_model()
self.processor = Sam3Processor(self.model)
finally:
print('Dude it wasnt the bpe tokenizer :(')
Metadata
Metadata
Assignees
Labels
No labels