Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

Hugging Face

Understanding Transformers

Learn by doing, understand by building:
explore the Transformer architecture through hands-on experiments with text, audio and images.

License: MIT Python Hugging Face Space Open in Colab

Live Demo · Notebook · What's inside · Run locally · References


What's inside

  • 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

Run locally

pip install -r requirements.txt
python app.py

ffmpeg is needed for reading mp3 files.

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

Notes

  • 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.

References

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages