kas84 / OpenAI-bring-your-own-data

Langchain | OpenAI | Train with Custom markdown data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LangChain X OpenAI - Bring your own data

Note: Currently, it only supports markdown & txt files. Maybe in the future, I will support more file types (like pdf, docx, xls, etc.)

How to use

Note: Add the OPENAI_API_KEY to your environment variables in the Gitpod dashboard OR in the .env file.

  1. Open in Gitpod, then you don't need to install anything on your local machine.

Open in Gitpod

  1. You can add your own data in the data folder. You can add multiple files in the data folder. The more data you add, the better the model will be. Currently, it only supports markdown & txt files.

  2. Run the following command:

    pyenv virtualenv 3.9.9 fun_openai_work
    pyenv activate fun_openai_work
    python server.py
  3. Open the url that is generated in the terminal. It will look something like this: http://127.0.0.1:5000/

  4. Ask your question with:

    http://127.0.0.1:5000/chat?question="something about siddhant"
    

    Output: image

Note: if you want to rebuild your db, just delete the "checkpoint" file. It will rebuild the db from scratch. And, then you can run the server again.

About

Langchain | OpenAI | Train with Custom markdown data


Languages

Language:Python 100.0%