A web application that transforms compiler-generated TT-NN code into human-readable format using Anthropic's Claude API.
- Transform compiler-generated PyTorch TT-NN code into human-friendly format
- Support for various model architectures (BERT, GPT, T5, ResNet, VGG, etc.)
- Interactive web interface for code input and transformation
- Easy copy-paste functionality for results
- Node.js (v14 or higher)
- An Anthropic API key
-
Clone the repository:
git clone https://github.com/ayerofieiev-tt/code-humanizer.git cd code-humanizer -
Install dependencies:
npm install -
Create a
.envfile based on the provided.env.example:cp .env.example .env -
Add your Anthropic API key to the
.envfile:ANTHROPIC_API_KEY=your_anthropic_api_key_here
-
Start the server:
npm start -
For development with auto-restart:
npm run dev -
Open your browser and navigate to
http://localhost:3000 -
Paste your TT-NN code, specify the model type, and click "Transform Code"
- The user inputs compiler-generated TT-NN code and specifies a model type
- The application sends the code and model type to the server
- The server uses Anthropic's Claude API to analyze and transform the code
- Claude applies the following transformations:
- Renames functions (e.g.,
ttnn_decorators_ttnn_*→ttnn.*) - Reorganizes the code structure
- Renames variables based on their purpose
- Adds explanatory comments
- Formats the code for readability
- Renames functions (e.g.,
- The transformed code is returned to the user interface
MIT