| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The full length Python autocompletion Video and a Twitter thread describing how it works
This is a learning/demo project to show how deep learning can be used to auto complete Python code. You can experiment with LSTM and Transformer models. We also have built a simple VSCode extension to try out the trained models.
It gives quite decent results by saving above 30% key strokes in most files, and close to 50% in some. We calculated key strokes saved by making a single (best) prediction and selecting it with a single key.
The dataset we use is the python code found in repos linked in Awesome-pytorch-list. We download all the repositories as zip files, extract them, remove non python files and split them randomly to build training and validation datasets.
We train a character level model without any tokenization of the source code, since it's the simplest.
You can also run the training notebook on Google Colab.
Clone this repo
Install requirements from requirements.txt
Install npm packages
You need to have Node.JS installed
cd vscode_extension
npm install # This will install the NPM packagesStart the server python_autocomplete/serve.py
Open the extension project (folder) in VSCode
cd vscode_extension
code . # This will open vscode_extension in VSCodeIf you don't have VSCode command line launcher start VSCode and open the project with File > Open
Run > Start Debugging
This will open another VSCode editor window, with the extension
Here's a sample evaluation of a trained transformer model.
Colors:
| Back | FazBrowse Home | New Git URL |