gpt2-tensorflow-localchat
is a simple CLI chat mode framework for Python, built for locally running GPT-2 models with TensorFlow. This tool provides an easy way to interact with GPT-2 models and fine-tune them on custom data sets or use them for unique, real-time applications.
Explore more about this project and its developments on GitHub: gpt2-tensorflow-localchat
- CLI-based interaction with GPT-2 models.
- Local deployment of TensorFlow models for privacy and control.
- Support for multiple command scripts to demonstrate various capabilities.
├── .gitignore
├── README.md
└── src/
├── Model-Battle.py # Battle between models: experimental feature
├── Model-Localtalk.py # Main script for local chat interactions
├── encoder.py # Manages text encoding and decoding
├── model.py # Core TensorFlow model definitions
├── olddemo.py # Old demonstration scripts for reference
├── sample.py # Sampling utilities for generating text
└── start_localtalk.sh # Script to start local chat environment(*)
(*) The purpose of the bash script is to suppress Tensorflow's output from interfering in the CLI output.
- Python 3.x
- TensorFlow 1.15 or higher (with
compat.v1
API support) - An environment supporting bash scripts (Linux/Unix)
- Clone the repository:
git clone https://github.com/FlyingFathead/gpt2-tensorflow-localchat.git
- Navigate into the project directory:
cd gpt2-tensorflow-localchat
- Install required Python libraries:
pip install -r requirements.txt
(Note: requirements.txt
currently not added in yet. Use your own local TF model files.)
To start a local chat with the model:
./src/start_localtalk.sh
This script sets the appropriate TensorFlow logging level and starts an interactive chat session using Model-Localtalk.py
.
v0.17
- local chat now usesGPUtil
to look for the best available CUDA GPUv0.16
-/clear
to clear out the context memoryv0.15
- bugfixes,/swap
for role-swapping between user and the modelv0.10
- initial commit
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Distributed under the MIT License. See LICENSE
for more information. Parts of the model loading code has been forked from OpenAI's GPT-2 source code.
- Project Link: https://github.com/FlyingFathead/gpt2-tensorflow-localchat
- Project Creator: Flyingfathead on GitHub