Install Private GPT library in your PC, train AI Models and Chat with your private docs offline
Private GPT helps you to Ingest your documents and get answers of your questions from your documents, locally/offline. We can implement the PrivateGPT using GitHub open source library called "privateGPT". Following is the the url to access the library which contains completed implementation details including prerequisite like system requirement, software required to run the code.
https://github.com/imartinez/privateGPT
Using Private GPT library we can query the offline documents without need of internet however while setup we required to connect to the internet. In this article i going to show you how to implement the PrivateGPT in your PC.
Following is the list of software to be installed in the PC before installing the PrivateGPT.
- Visual Studio Code
- latest GIT
- Latest Python
- Visual Studio 2022 (Make sure you select Universal Windows Platform development, C++ CMake tools for Windows components while installing)
- MinGW installer with gcc component
Once you install the above software into your PC you need to copy the PrivateGPT GitHub repository url available in above GitHub repository link. open visual studio code and go to the View >>Terminal then go to the location where you want to download the PrivateGPT code using cd command and enter the below command.
git clone https://github.com/imartinez/privateGPT.git
Once your code gets downloaded then in visual studio code and in menu bar go to File>>Open Folder then select the privateGPT folder which you have downloaded from git as follows.
Now you can see the folder structure of the private GPT application as above. Now we need to download the model from the url provided in the PRivateGPT GitHub Repository link provided above. Once you download the file then create the folder named "Models"in root directory of PrivateGPT application and past the model file as shown in below figure.
Now go to the View >>Terminal and you will be able to run power shell command in the terminal.
Now rename example.env file to .env as shown in below figure.
Now you need to enter below command to install the required components for running the privateGPT. Please remember on this command it requires internet connection to download the necessary files.
pip3 install -r requirements.txt
Once the component downloading and installing done the you need to enter following command to train the models with your local documents which is resides in source_documents folder. This command will take some time depending upon the size of your docs.
python ingest.py
Once the ingest command finishes we are good to go for running privateGPT application, enter below command to run the application and chat with it.
python privateGPT.py
in above figure i have queried "what is inheritance with example" and following is the output of the query.
Following is the time taken to get the results for above query it will depending upon the hardware you have in your PC, if you have better hardware then this time can be reduce.
and following figure shows the source documents from where the privateGPT found the answer.
That's it you have successfully implemented the PrivateGPT in your PC.
Comments
Post a Comment