Git Product home page Git Product logo

chatgpt-q-a-chatbot-with-custom-data's Introduction

ChatGPT-Q-A-Chatbot-with-custom-data

ChatGPT chatbots with customised knowledge. Train ChatGPT on a niche set of knowledge that ChatGPT does not know about. Written in Python so, of course install python if you don't have it.

How to use

Step 1 - pip install gpt_index

Step 2 - pip install langchain

Step 3 - edit key_openai.txt and put your own api key there. Register an account at openai.com if you don't have one.

Step 4 - Try asking chat gpt via the normal chat gpt interface "what does sex 1.0 mean" or any of the other questions contained in /data/training.txt and you will see that it does not know. This info is contained in a book I wrote called Sex 3.0 which is about a cognitive model of how to relate in the romantic / sexual realm. You can find here on amazon https://www.amazon.com/Sex-3-0-Sexual-Revolution-Manual/dp/1468134329 but GPT has never read it

Step 5 - From the command line use 'python chatbot.py' to run the training and the bot and ask it about sex 1.0, 2.0 or 3.0. Their core designs and the eras that they exist in and it can now answer all the questions contained in /data/training.txt so just put the info your want to train gpt with in this file instead.

Step 6 - If you quit the program and then comment out line 44. The line that trains GPT that goes "index = construct_index("data/")" and run the program again and ask the same questions you will see that it has retained the new training without needing to be trained again as it is based off the training data in the .json file that you already created.

Step 7 (optional) - If you want to enable PDF support you only need to add one line to this code. Just add 'import PyPDF2' at the top with the rest of the import statements (of couse you need to 'pip install PyPDF2' for this to work). As this code uses SimpleDirectoryReader that means that it will read every .txt and, if you add import PyPDF2, every PDF in the /data folder. It will vectorise all of them in order to create your .json file. So if you don't want old training data to be added into your .json file when it is being created then move it out of the /data dir and put it somewhere else. Only files that you want to be part of your .json file should be in the data folder.

chatgpt-q-a-chatbot-with-custom-data's People

Contributors

jjrobertssex30 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chatgpt-q-a-chatbot-with-custom-data's Issues

How to clear cache

I've made a python pg to give it a try. Everything seemed so good.
But after changing all data in the traning.txt to some completly different stuff , I found that those old contents still showed up as answers.
It seemed that those old ones were cached in openai server side.
Is that true and any suggestions to delete these caches or walk round ? Thank you !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.