maomao88's picture
more updates
119afbd
---
title: Transformer Model Structure Visualizer
emoji: 🧩
colorFrom: indigo
colorTo: green
sdk: docker
app_file: backend/app.py
pinned: false
license: mit
short_description: Visualize transformer architectures.
tags:
- transformers
- visualization
- attention
- model-architecture
- huggingface
- model-layers
- model-structure
- hidden-states
---
# Run the app locally
This app is developed using React + Fastapi. You can run this app locally with the following steps.
### Run Frontend
1. Install dependencies:
```
npm i
```
2. Run the app:
```commandline
npm run dev
```
3. Open the browser and access the service from http://localhost:5173/
### Run Backend
1. **Activate the virtual environment**
Make sure you have your Python virtual environment set up and activated.
2. **Navigate to the backend directory**
```commandline
cd backend
```
3. **Install dependencies**
```commandline
pip install -r requirements.txt
```
4. **(Optional) Install GPU-related packages**
If you are running on a GPU-enabled device, you can install additional packages (support for more models):
```commandline
python install_gpu_packages.py
```
5. **Start the backend server**
Run the FastAPI app with Uvicorn:
```commandline
uvicorn app:app --reload --host 0.0.0.0 --port 8000
```