jonfairbanks / local-rag

Ingest files for retrieval augmented generation (RAG) with open-source Large Language Models (LLMs), all without 3rd parties or sensitive data leaving your network.
GNU General Public License v3.0
449 stars 52 forks source link

Device busy errors experienced when running on Windows/WSL #17

Closed molbal closed 4 months ago

molbal commented 4 months ago

Hi there,

Getting an error when I'm trying to load a .txt file for embedding.

Steps to reproduce/environment: Ollama runs on host Windows installation (no known bugs encountered) local-rag runs containerized, reaches ollama via 'host.docker.internal' hostname (finds available models) I try to add any file or github repository and it fails: image

Console: 2024-02-28 12:58:06 local-rag | 2024-02-28 12:58:06 local-rag | You can now view your Streamlit app in your browser. 2024-02-28 12:58:06 local-rag | 2024-02-28 12:58:06 local-rag | URL: http://0.0.0.0:8501 2024-02-28 12:58:06 local-rag | vocab.txt: 100%|██████████| 232k/232k [00:00<00:00, 1.63MB/s] tokenizer.json: 100%|██████████| 711k/711k [00:00<00:00, 2.29MB/s] special_tokens_map.json: 100%|██████████| 125/125 [00:00<00:00, 551kB/s] Loading files: 100%|██████████| 2/2 [00:00<00:00, 100.34file/s] Parsing nodes: 100%|██████████| 2/2 [00:00<00:00, 588.76it/s] Generating embeddings: 100%|██████████| 2/2 [00:01<00:00, 1.83it/s] 2024-02-28 12:59:12 local-rag | 2024-02-28 03:59:12,451 - local_files - ERROR - Failed to delete data files: [Errno 16] Device or resource busy: '/home/appuser/data'

jonfairbanks commented 4 months ago

This could happen if that file is open or in-use elsewhere.

I'll do some deeper testing on Windows yet this week to cover some of these corner cases.

molbal commented 4 months ago

Cheers. The files should not be used anywhere else, I did not manually do anything with the directory. If you do Windows testing, you should use WSL or run it in container, because one of the dependencies does not support it.

I get 'RuntimeError: uvloop does not support Windows at the moment' when I try to run pipenv install

jonfairbanks commented 4 months ago

@molbal This should be working now. I was able to run a test on Windows 11 + Docker Desktop + PDF upload successfully.

You can either re-download the repo or update your docker-compose.yml to remove the volumes section:

volumes:
  - ./data:/home/appuser/data:rw
molbal commented 4 months ago

Perfect! Thank you for the very quick fix.