From 7bd5b909e698da959d440fabce5adc046d4c2f7d Mon Sep 17 00:00:00 2001 From: Niaz Date: Wed, 14 Aug 2024 17:57:45 +0200 Subject: [PATCH] Add docs for offline usage --- docs/user-guide/offline-setup.md | 67 ++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/user-guide/offline-setup.md diff --git a/docs/user-guide/offline-setup.md b/docs/user-guide/offline-setup.md new file mode 100644 index 0000000..c8e67d2 --- /dev/null +++ b/docs/user-guide/offline-setup.md @@ -0,0 +1,67 @@ +--- +title: "Offline Usage" +excerpt: "Learn how to configure LibrePhotos for complete offline usage by manually downloading and placing the required machine learning models. This guide provides step-by-step instructions to ensure your LibrePhotos installation functions seamlessly without an Internet connection." +sidebar_position: 5 +--- + +To enable LibrePhotos to work completely offline by manually downloading and placing the required machine learning models, you can follow the steps outlined below. This guide assumes that you have access to the Internet initially to download the models and then configure LibrePhotos to run in an offline environment. + +### Step 1: Download the Models Manually + +Manually download the necessary models from their respective URLs. Below is a list of models used by LibrePhotos, along with their download links: + +1. **im2txt** (Captioning) + - URL: `https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt.tar.gz` +2. **clip-embeddings** (CLIP) + - URL: `https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/clip-embeddings.tar.gz` +3. **places365** (Categories) + - URL: `https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/places365.tar.gz` +4. **resnet18** (Categories) + - URL: `https://download.pytorch.org/models/resnet18-5c106cde.pth` +5. **im2txt_onnx** (Captioning) + - URL: `https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt_onnx.tar.gz` +6. **blip_base_capfilt_large** (Captioning) (optional) + - URL: `https://huggingface.co/derneuere/librephotos_models/resolve/main/blip_large.tar.gz?download=true` +7. **mistral-7b-v0.1.Q5_K_M** (LLM) (optional) + - URL: `https://huggingface.co/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/mistral-7b-v0.1.Q5_K_M.gguf?download=true` +8. **mistral-7b-instruct-v0.2.Q5_K_M** (LLM) (optional) + - URL: `https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q5_K_M.gguf?download=true` + +### Step 2: Place the Models in the Correct Location + +Once the models are downloaded, place them in the following directory: + +``` +/data_models/ +``` + +For example, if your `MEDIA_ROOT` is set to `/var/lib/librephotos`, then the models should be placed in `/var/lib/librephotos/data_models/`. + +- **im2txt.tar.gz** -> Unpack into `/data_models/im2txt/` +- **clip-embeddings.tar.gz** -> Unpack into `/data_models/clip-embeddings/` +- **places365.tar.gz** -> Unpack into `/data_models/places365/` +- **resnet18-5c106cde.pth** -> Place directly as `/data_models/resnet18-5c106cde.pth` +- **im2txt_onnx.tar.gz** -> Unpack into `/data_models/im2txt_onnx/` +- **blip_large.tar.gz** -> Unpack into `/data_models/blip/` +- **mistral-7b-v0.1.Q5_K_M.gguf** -> Place directly as `/data_models/mistral-7b-v0.1.Q5_K_M.gguf` +- **mistral-7b-instruct-v0.2.Q5_K_M.gguf** -> Place directly as `/data_models/mistral-7b-instruct-v0.2.Q5_K_M.gguf` + +### Step 3: Verify Model Placement + +Ensure that all models are correctly placed and unpacked in their respective directories. The structure should look something like this: + +``` +data_models/ + ├── im2txt/ + ├── clip-embeddings/ + ├── places365/ + ├── resnet18-5c106cde.pth + ├── im2txt_onnx/ + ├── blip/ + ├── mistral-7b-v0.1.Q5_K_M.gguf + └── mistral-7b-instruct-v0.2.Q5_K_M.gguf +``` + +### Step 4: Run LibrePhotos + +You can now run LibrePhotos without an active Internet connection. The application will use the models you manually downloaded and placed in the `data_models` directory.