How dedocrad/mini-transformer works
mini-transformer is a Streamlit demo that reverses Latin-letter strings with a trained encoder–decoder Transformer. The main workflow takes a prompt, tokenizes it, autoregressively predicts a reversal, displays an exact-match result, and logs inference details to MLflow. The README also identifies training data, saved weights, and notebooks for dataset preparation, training, and inference; their internals were not sampled, so those capabilities are shown only at the directory level. The graph omits deployment wiring beyond the documented shared MLflow storage.
Main entry points: app.py Streamlit app · stuff.py Autoregressive inference · notebooks Data, training, inference notebooks · tokenizer.py Character tokenizer
Components 9
Inference interface
- Streamlit app
src/app.py - MLflow tracking store
src/mlflow.db
Inference runtime
- Character tokenizer
src/tokenizer.py - Autoregressive inference
src/stuff.py - Seq2seq Transformer
src/model.py
Training assets
- Saved weights
models/best_model.pth - Training data
data/random_words.csv - Data, training, inference notebooks
notebooks
Other components
- User
Connections 9
- User → Streamlit app: enters prompt
README.md - Streamlit app → Character tokenizer: encodes prompt
src/app.py - Streamlit app → Seq2seq Transformer: loads weights
src/app.py - Streamlit app → Autoregressive inference: requests prediction
src/app.py - Autoregressive inference → Character tokenizer: encodes and decodes
src/stuff.py - Autoregressive inference → Seq2seq Transformer: runs encoder and decoder
src/stuff.py - Streamlit app → MLflow tracking store: logs result
src/app.py - Training data → Data, training, inference notebooks: supports preparation
README.md - Data, training, inference notebooks → Saved weights: supports training
README.md