A web application that visualizes GPT model token generation and probabilities in real-time. Built with React frontend and Python backend.
- Interactive text generation from prompts
- Visual token nodes graph with interaction
- Token probability analysis
- Real-time decoding visualization
- Customizable generation parameters
Gpt2-token-prob/
├──gpt_visualizer/
├──frontend/ # React application
└── backend/ # Python Flask API
- Node.js and npm
- Python 3.x
- Virtual environment (venv)
- Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Frontend Setup
cd frontend
npm install
- Start the backend server:
cd backend
source venv/bin/activate # On Windows: venv\Scripts\activate
./run.sh # On Windows: run.bat
- Start the frontend development server:
cd frontend
npm start
The application will be available at http://localhost:3000
- Frontend is built with React and uses Material-UI for components
- Backend uses Flask for API endpoints
- Token visualization implemented using React-based graph visualization
This project is licensed under the MIT License.