maomao88's picture
more updates
119afbd
metadata
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:

    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

    cd backend
    
  3. Install dependencies

    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):

    python install_gpu_packages.py
    
  5. Start the backend server

    Run the FastAPI app with Uvicorn:

    uvicorn app:app --reload --host 0.0.0.0 --port 8000