Subscribe to Youtube channel

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 
 
 
 git clone PrivateGPT 


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.

 

 
 
 
 
 
 
 

PrivateGPT folder

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.

PrivateGPT Models

Now go to the View >>Terminal and you will be able to run power shell command in the terminal.

terminal 1


terminal 2
 

Now rename example.env file to .env as shown in below figure.
 

env setup 1

 
env setup 2


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  
privateGPT install


 

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  


doc ingest


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  


 
 
privateGPT run 2

in above figure i have queried "what is inheritance with example" and following is the output of the query.

privateGPT run 1result

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.

privateGPT run 2 result

and following figure shows the source documents from where the privateGPT found the answer.

privateGPT run 3 result

That's it you have successfully implemented the PrivateGPT in your PC.


Comments

Popular posts from this blog

Implement Logging in CSV file using Nlog in .net core MVC application- part 2

Implement Nlog in .Net core MVC application part 1

Disable backspace key using Jquery

Devexpress Datebox date formatting in angular 6 with example

Angular User Session Timeout example step by step

Restore the lost focus of Auto post back controls in asp.net update Panel control

How to Import CSV File and bind csv file data to gridview in asp.net using c#

Remove Owin from MVC 5 Application and use asp.net custom forms authentication

Configure archival and purging of log file in Nlog