mazzzystar / Queryable

Run OpenAI's CLIP and Apple's MobileCLIP model on iOS to search photos.
https://queryable.app
MIT License
2.67k stars 421 forks source link

24000 images, memory leak caused crashes during construction. #41

Open lichangy opened 5 months ago

lichangy commented 5 months ago

24000 images, memory leak caused crashes during construction. The "prediction" method of MLModel leads to a continuous increase in memory.

mazzzystar commented 2 months ago

You're right. I tried to write a version using Claude 3.5 Sonnet that controls memory, for example, checking the current memory after each batch and then updating the batch size. This seems to be able to control memory usage. However, the problem is that the indexing speed becomes significantly slower.

If you don't mind the indexing speed slowing down, you can give it a try.

antgiant commented 2 months ago

I would be willing to give it a try.