15
0
Fork 0

Personalize a ChatGPT for your own documents.

README.md

PersonalGPT

Ever wanted to have ChatGPT personalized with your own documents? This project lets you quickly and easily ask questions of a set of files.

Try it for yourself

This repository includes a snapshot of XetHub documentation as the default data. Navigate to the Capsules tab and type in a question about XetHub to see how it does. Give it a shot!

Customize and remix

Ready to build your own question answerer? Use PersonalGPT as a starting point for your own app and customize away!

Setup

Install our tools and set up your account if you haven't already, then click the Duplicate button on the top right to make a copy of this project in your account. Use the Settings tab to set visibility to Private if you want to keep your PersonalGPT to yourself.

Our PersonalGPT uses OpenAI and LangChain to provide question answering. Create an OpenAI account and go to the API keys page to generate your key. Export the key as an environment variable to ensures that you won't accidentally leak it if you share your repository:

export OPENAI_API_KEY="<your OpenAI API key>"

Develop

  1. Update this repository locally with your chosen files. Start by copying the repository to your machine:

    • Using Git-Xet (recommended):

      git-xet clone https://<your username>/PersonalGPT.git
      cd PersonalGPT
      
    • Using Xet CLI:

      xet cp -r xet://<your username>/PersonalGPT/main PersonalGPT
      cd PersonalGPT
      
  2. This app was developed with Python 3.9. Set up your Python environment:

    # create and activate a virtual environment
    python -m venv venv
    source venv/bin/activate
    
    # install dependencies
    pip install -r requirements.txt
    
  3. Replace the default files in the data/ directory with any set of text files.

  4. Train your app with your new data.

    python src/train.py

  5. Run your app locally.

    gradio src/app.py

  6. If everything looks good, commit your changes:

    • Using Git-Xet (recommended):
    git add .
    git commit -am "Update app with my files"
    git push
    
    • Using Xet CLI:
    xet cp -r PersonalGPT xet://<your username>/PersonalGPT/main -m "Update app with my files"
    

Launch and share

Ready to share your question answerer with a wider audience? Capsules make it easy to deploy Python apps on XetHub.

Once your project is ready, go to the Capsules tab and click Change under the App Settings box. This will bring up a Settings page where you can add your OpenAI API key as a secret. To print out your API key environment variable, run:

printenv OPENAI_API_KEY

Click Update Settings and then launch your capsule. You can easily share capsules in public repositories with others with their URLs or by clicking Share Capsule under the branch dropdown menu. To add others to a private repository to add more documents, invite a collaborator.

Feedback

Let us know what you think of this repository. What's missing or needs improvement? File an issue or reach out directly to share your thoughts. Thanks for being part of our community!

File List Total items: 8
Name Last Commit Size Last Modified
assets Simplify design 12 months ago
data Reorganize data dir 10 months ago
model Update Gradio app and model 10 months ago
src Update Gradio app and model 10 months ago
.gitattributes Initial commit 79 B 1 year ago
.gitignore Better error display & validation 287 B 1 year ago
README.md Update README 3.4 KiB 10 months ago
requirements.txt Update README and default files 219 B 10 months ago

About

Personalize a ChatGPT for your own documents.

Repository Size

Loading repo size...

Commits 32 commits

File Types