Learn by doing, understand by building:
explore the Transformer architecture through hands-on experiments with text, audio and images.
Live Demo · Notebook · What's inside · Run locally · References
- GPT-2: greedy, top-k, top-p, temperature and random sampling, plus next-token probabilities
- Tokenizer: how GPT-2 splits words into tokens
- Sentiment analysis: DistilBERT (general) and FinBERT (financial)
- Named entity recognition, question answering and machine translation (NLLB-200)
- Audio: waveform and mel spectrogram, classification (AST), speech-to-text, text-to-speech
- Image processing: RGB channels, grayscale and resizing
pip install -r requirements.txt
python app.pyffmpeg is needed for reading mp3 files.
| File | Description |
|---|---|
transformel.ipynb |
Experiments and notes |
app.py |
Gradio demo app |
requirements.txt |
Python dependencies |
packages.txt |
System packages (for Spaces) |
elmo.jpg, sea.jpg, white-flower.jpg |
Sample images |
Hugging-Face-Course_Resources_audio.mp3 |
Sample audio |
- Models download on first use, so the first run of each tab is slow.
- The diffusion experiments in the notebook (Stable Diffusion, video) need a GPU and are not part of the app.