Replies: 1 comment
-
Ingesting large filesIf you get this error when ingesting large files like whole books sqlite3.OperationalError: too many SQL variables Lookup solutions from #489 This seems to be a problem with chromadb.
You can diff your embeddings_queue.py with this attached file. Please note that this is from chromadb==0.4.6, so if your chromadb is the newer 0.4.12, the file will be much different. The only problem I have with this solution is that everytime chromadb is reinstalled or updated, the embeddings_queue.py file will need to be modified again. Converting pdf, epub, and mobi to textI manually convert open access pdf, epub, and mobi to text first rather than relying on ingest.py because some files will have erroneous text flow and will require to be ocr'ed again. Using pandoc I just run the following on the source folder:
Warning in running run_localGPT_API.pyIf you used ingest.py to manually ingest your sources and use the terminal-based run_localGPT.py, DO NOT use the webui run_localGPT_API.py as it seems to reset the DB. |
Beta Was this translation helpful? Give feedback.
-
For novices like me, here is my current installation process for Ubuntu 22.04, in an anaconda environment.
There appears to be a lot of issues with cuda installation so I'm hoping this will help someone with a similar context:
OS: Ubuntu 22.04
Python environment: Anaconda3-2023.07-2-Linux-x86_64.sh
CUDA version: 11.7.0 (conda installation)
cuDNN version: 8.5.0.96 (downloaded from https://developer.nvidia.com/rdp/cudnn-archive ; I selected this cuDNN version because it appears to be the cudnn version that comes with pytorch with cuda 11.7)
test hardware
OLD CPU: AMD FX-8320E (no AVX2)
OLD GPU: 2x Quadro P4000
Please note that I removed all other installations of CUDA and cuDNNin my system as they affect the conda installation. I used a conda restricted install of cuda so as not to conflict with other anaconda environments. This would include:
1. Create and activate a new virtual environment
conda create -n localGPT python=3.10.0
conda activate localGPT
2. Install cuda-toolkit in the conda environment
conda install -c "nvidia/label/cuda-11.7.0" cuda-toolkit
3. Copy cuDNN files to the cuda installation
extract cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
cd to the extracted folder
cp include/cudnn*.h ~/anaconda3/envs/localGPT/include
cp lib/libcudnn* ~/anaconda3/envs/localGPT/lib
4. Install pytorch with cuda support (see install matrix at https://pytorch.org/ for your context)
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
5. Clone the repo using git
git clone https://github.com/PromtEngineer/localGPT.git
cd localGPT
6. Install the requirements
pip install -r requirements.txt
At this point I got some warning from pip:
extract-msg 0.45.0 requires olefile==0.46, which is not installed.
oletools 0.60.1 requires olefile>=0.46, which is not installed.
oletools 0.60.1 requires pyparsing<3,>=2.1.0, but you have pyparsing 3.0.9 which is incompatible.
So I installed the following packages:
pip install olefile==0.46
pip install pyparsing==2.3.1
7. Uninstall and reinstall auto-gptq from source
To resolve the following when running localGPT with GPTQ models: WARNING - qlinear_old.py:16 - CUDA extension not installed.
pip uninstall -y auto-gptq
GITHUB_ACTIONS=true pip install auto-gptq==0.2.2 --no-cache-dir
8. Install llama-cpp
CMAKE_ARGS="-DLLAMA_CUBLAS=1" FORCE_CMAKE=1 pip install --upgrade --force-reinstall llama-cpp-python==0.1.83 --no-cache-dir --verbose
Check the log output if the build can find your cuda installation .
Check ~/anaconda3/envs/localGPT/include if cuda files are present.
If your CPU does NOT support AVX2, disable it:
CMAKE_ARGS="-DLLAMA_CUBLAS=1 -DLLAMA_AVX2=OFF -DLLAMA_F16C=ON" FORCE_CMAKE=1 pip install --upgrade --force-reinstall llama-cpp-python==0.1.83 --no-cache-dir --verbose
9. Ingest data
python ingest.py
10. Ask questions to your documents, locally!
python run_localGPT.py --show_sources
If you have a better way to improve this procedure e.g. using higher cuda and cudnn versions, sharing it is appreciated.
Optional for targetting a second gpu so as not to use up your gpu for display/output
For this I prefer using the GPU UUID, so find the gpu you want to use for localGPT:
nvidia-smi -L
Create a bash script (i created mine inside the localGPT folder) e.g.
nano run_localGPT.sh
enter the following content:
make the script executable then run it.
./run_localGPT.sh
there is an nvidia-smi way to monitor if the gpu is being used, but I just look at the thermals in Nvidia Xserver Settings
Beta Was this translation helpful? Give feedback.
All reactions