Skip to content

pjsample/simple_gpt3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple GPT-3

A lightweight client for interacting with GPT-3 in your terminal or by using a web UI that you run locally. All calls to GPT-3 use the GPT-3 API so you'll need an OPENAI API key. OpenAI

Useful for work

Simple_GPT-3 Example2

And fun!

Simple_GPT-3 Example1

Getting it to work

pip install openai
pip install prompt-toolkit
git clone [email protected]:pjsample/simple_gpt3.git

cd simple_gpt3
chmod +x simple_gpt3.py
cp simple_gpt3.py simple_gpt3

export PATH=$PATH:$PWD

export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"

simple_gpt3

Optional parameters

usage: simple_gpt3 [--model MODEL] [--max-tokens MAX_TOKENS] [--temperature TEMPERATURE]
                      [--api_key API_KEY]

Defaults:
--model text-davinci-002
--max-tokens 2000
--temperature 0

To permanently add environment variables

Add these lines to `~/.zshrc` (or whichever file is appropriate for your terminal)

export PATH="/DIR_WHERE_YOU_CLONED_SIMPLE_GPT3:$PATH"

export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"

Local Web UI

WebUI Example

Local Web UI Setup

pip install openai
pip install gradio
git clone [email protected]:pjsample/simple_gpt3.git

export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"

cd simplt_gpt3

# Run the web UI
python web_UI.py

# Then follow think link in the terminal

About

A lightweight script for calling GPT-3 in your terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages