Changes
1 changed files (+9/-5)
-
-
@@ -4,19 +4,23 @@ Semantic file search using FastEmbed and sqlite-vec## Installation TODO: THESE INSTRUCTIONS ARE OUTDATED. We probably want separate installation for users and installation for devs sections Run `pip install -e .` or alternatively `uv sync`. For Intel GPUs, install OpenCL drivers (for example `intel-compute-runtime`) and run `uv sync --extra intel_gpu`. Install it using `pipx install git+https://git.unnamed.website/search/` or `uv tool install git+https://git.unnamed.website/search/`. For Intel GPU support, install OpenCL drivers (for example `intel-compute-runtime`) and run `uv tool install git+https://git.unnamed.website/search/[intel_gpu]`, although you may need to add the flag `-p 3.12` or some other Python version if dependency resolution fails. ## Usage This program uses a client-server architecture to watch directories with inotify and keep the model in memory so the client doesn't have to wait several seconds to load the model. It uses file inodes and modification times to avoid unnecessary re-indexing. Additionally, the client only depends on the Python standard library. Run `python server.py DIRS_TO_INDEX` to start the server. Make sure you don't include nested directories or weird stuff will happen. The server currently only indexes images although more modalities may be supported in the future. There are probably some weird race condition bugs if you modify a lot of files at the same time. Run `search-server DIRS_TO_INDEX` to start the server. Make sure you don't include nested directories or weird stuff will happen. The server currently only indexes images although more modalities may be supported in the future. There are probably some weird race condition bugs if you modify a lot of files at the same time. Then run `python client.py SEARCH_TEXT NUM_RESULTS` to get a list of the most similar files, or search for a path instead of text for a file to similar file search. You can pass the list of results to an image viewer such as Gwenview to view image results, although note that Gwenview doesn't preserve the order of the images. Alternatively, add a third parameter to `python client.py` and it will create a temporary directory containing symlinks to the search results and return the directory name. Then run `search-client SEARCH_TEXT NUM_RESULTS` to get a list of the most similar files, or search for a path instead of text for a file to similar file search. You can pass the list of results to an image viewer such as Gwenview to view image results, although note that Gwenview doesn't preserve the order of the images. Alternatively, add a third parameter to `search-client` and it will create a temporary directory containing symlinks to the search results and return the directory name. Check out [TIDY](https://github.com/slavabarkov/tidy) (for Android) and [rclip](https://github.com/yurijmikhalevich/rclip) for similar projects, although this one is probably fastest! ## Development This project uses [uv](https://github.com/astral-sh/uv). Clone this repo and run `uv sync`. For Intel GPUs, run `uv sync --extra intel_gpu`. Use `uv run search-server` and `uv run search-client` to run your cloned versions of the code. If you don't like uv, you might be able to just `pip install -e .` and run `server.py` and `client.py` directly with Python. ## TODO
-