File size: 1,386 Bytes
12e023b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Visualization

This repository contains visualization tools for the LLaDA project.

## Implementation Steps

### Step 1: Generate Sampling Process
Run `generate.py` to produce your own sampling process records. A sample output (`sample_process.txt`) is included for reference. You have the option to:
- Utilize the provided generate.py script
- Modify both the prompt and generation parameters

### Step 2: Generate Visualization HTML
Choose between two visualization styles:
- **Paper Style**:  
  `visualization_paper.py` produces visualizations matching the format in [our arXiv paper](https://arxiv.org/abs/2502.09992)
- **Zhihu Style**:  
  `visualization_zhihu.py` generates visualizations compatible with [Zhihu's format](https://zhuanlan.zhihu.com/p/24214732238)

The scripts will:
1. Automatically create an `html/` directory
2. Generate individual HTML files for each sampling step

*Note: The current implementation defaults to 64 sampling steps. 



### Step 3: Create PNG Sequences

Convert generated HTML files to PNG format for GIF creation. These image sequences can be used with any standard GIF generator to visualize the complete sampling process.



## Technical Notes

- Ensure Python 3.8+ environment

- Install required dependencies: `pip install html2image`

- For custom configurations, modify constants at the beginning of each script