Jabberwocky
neil_degrasse_tyson_with_audio.mp4
Project Description
This GUI provides an audio interface to GPT-3. My main goal was to provide a convenient way to interact with various experts or public figures: imagine discussing physics with Einstein or hip hop with Kanye (or hip hop with Einstein?
We also provide Task Mode containing built-in prompts for a number of sample tasks:
- Summarization
- Explain like I'm 5
- Translation
- How To (step by step instructions for performing everyday tasks)
- Writing Style Analysis
- Explain machine learning concepts in simple language
- Generate ML paper abstracts
- MMA Fight Analysis and Prediction
Getting Started
- Clone the repo.
git clone https://github.com/hdmamin/jabberwocky.git
- Install the necessary packages. I recommend using a virtual environment of some kind (virtualenv, conda, etc). If you're not using Mac OS, you could try installing portaudio with whatever package manager you're using, but app behavior on other systems is unknown.
brew install portaudio
pip install -r requirements.txt
python -m nltk.downloader punkt
If you have make
installed you can simply use the command:
make install
- Add your openai API key somewhere the program can access it. There are two ways to do this:
echo your_openai_api_key > ~/.openai
or
export OPENAI_API_KEY=your_openai_api_key
(Make sure to use your actual key, not the literal text your_openai_api_key
.)
- Run the app.
python gui/main.py
Or with make
:
make run
Usage
Conversation Mode
In conversation mode, you can chat with a number of pre-defined personas or add new ones. New personas can be autogenerated or defined manually.
See data/conversation_personas
for examples of autogenerated prompts. You can likely achieve better results using custom prompts though.
Conversation mode only supports spoken input, though you can edit flawed transcriptions manually. Querying GPT-3 with nonsensical or ungrammatical text will negatively affect response quality.
Task Mode
In task mode, you can ask GPT-3 to perform a number pre-defined tasks. Written and spoken input are both supported. By default, GPT-3's response is both typed out and read aloud.
Transcripts of responses from a small subset of non-conversation tasks can be found in the data/completions
directory. You can also save your own completions while using the app.
Usage Notes
The first time you speak, the speech transcription back end will take a few seconds to calibrate to the level of ambient noise in your environment. You will know it's ready for transcription when you see a "Listening..." message appear below the Record button. Calibration only occurs once to save time.
Hotkeys
CTRL + SHIFT: Start recording audio (same as pressing the "Record" button).
CTRL + a: Get GPT-3's response to whatever input you've recorded (same as pressing the "Get Response" button).
Project Members
- Harrison Mamin
Repo Structure
jabberwocky/
βββ data # Raw and processed data. Some files are excluded from github but the ones needed to run the app are there.
βββ notes # Miscellaneous notes from the development process stored as raw text files.
βββ notebooks # Jupyter notebooks for experimentation and exploratory analysis.
βββ reports # Markdown reports (performance reports, blog posts, etc.)
βββ gui # GUI scripts. The main script should be run from the project root directory.
βββ lib # Python package. Code can be imported in analysis notebooks, py scripts, etc.
The docker
and setup
dirs contain remnants from previous attempts to package the app. While I ultimately decided to go with a simpler approach, I left them in the repo so I have the option of picking up where I left off if I decide to work on a new version.