mazzzystar / Queryable

Run OpenAI's CLIP model on iOS to search photos.

Home Page:https://queryable.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Abnormal operation on A12 and lower chips

mazzzystar opened this issue · comments

Currently, Queryable does not support devices below the iPhone 11 (with the A13 chip). On these devices, indexing can be built normally, but the search results for any query are the same, and I haven't debugged the problem. If you find a solution, I would greatly appreciate it if you could submit a PR.

Hi,
I managed to make the project work on an iPhone X.
On the TextEncoder init, you need to add the following line to force CPU only on older iPhones.

config.computeUnits = .cpuOnly

Based on information found here:

Wow! Do we need to use if/else to handle different iPhone devices? Or, if we change this line, would it affect the newer iPhone perfomance?

config.computeUnits = .cpuOnly

BTW, it would be nice if you could submit a PR to fix the issue : )

Yeah ideally an if/else is needed to ensure MLModel continues using default configuration on newer iPhones (default is CPU, GPU and Neural Engine).

I will submit a PR later today.