This repository contains the code for a web-based Transformer model interface, designed to visualize attention maps and test predictions using Flask and PyTorch.
- Interactive Web Interface: A Flask-based web interface for interacting with the Transformer model.
- Attention Map Visualization: Visualize how the model focuses on different parts of the input.
- Model Prediction: Test the model's predictions based on user input.
To set up the project environment, follow these steps:
- Clone the repository:
git clone https://github.com/yourusername/your-repository.git cd your-repository
- Install the required packages:
pip install torch torchvision torchaudio matplotlib flask datasets
- Run the application with python3 main.py
The application will be available at http://127.0.0.1:5000/ on your local machine.
Usage
To use the application, navigate to http://127.0.0.1:5000/ in your web browser. You can start training the model, visualize the attention map, and enter text to see the model’s predictions.