bpe_simple_vocab_16e6.txt.gz missing
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 :(')
i had the same issue today after their update yesterday so if you wanna run the model just do this. from sam3.model_builder import build_sam3_image_model from sam3.model.sam3_image_processor import Sam3Processor
model = build_sam3_image_model("sam3/sam3/assets/bpe_simple_vocab_16e6.txt.gz") processor = Sam3Processor(model, confidence_threshold=0.3)
I have requested a pull for this issue #359
Still facing same issue, the solution from @houssineidoudi12 works for now.