News for hackers. Stuff that matters.

Show HN: Autocomplete Python Code with Transformers

This is a small project we created to train a character level autoregressive transformer (or LSTM) model to predict Python source code. We trained it on GitHub repositories found on awesome pytorch list.

Github repo: https://github.com/lab-ml/python_autocomplete

You can try training on Google Colab: https://colab.research.google.com/github/lab-ml/python_autocomplete/blob/master/notebooks/train.ipynb

Here are some sample evaluations/visualizations of the trained model: https://colab.research.google.com/github/lab-ml/python_autocomplete/blob/master/notebooks/evaluate.ipynb

Working on a simple VSCode extension to test this out. Will open source it soon on the same repository.

( 2 comments | 3 points | on HN )
Re:Show HN: Autocomplete Python Code with Transformers by vpj on Monday January 04, 2021 @05:32AM (#25629605)
Re:Show HN: Autocomplete Python Code with Transformers by alexanderrofail on Tuesday January 05, 2021 @10:14AM (#25646316)
https://www.kite.com/ does this too, claiming 47% less keystrokes. They are a good benchmark to set for seeing how efficient the model can get.