/Codeon

Code Generation and Search for Python

Primary LanguagePython

Codeon

Code generation and code search for Python and Javascript.

Similar to GitHub Copilot with one major difference: Code search is leveraged to make up for smaller models and less data. The generation model makes use of search results along with code context to generate contextual code. Moreover, code search results from all over GitHub are displayed in a seperate file along with the exact url of the source code.

VSCode extention:

https://marketplace.visualstudio.com/items?itemName=samipdahal.codeon

Code Generation:

Currently, GPT-Neo-125M model is used for generation.

Training code is under 'gen' directory.

Demo Video Dark

Demo Video Light

Code Search:

Codebert-base model is used for code search, along with nearest neighbor approximation algorithm ScaNN. CodeSearchNet dataset is used as codebase to search over.

Code to finetune the model and setup ScaNN is under 'search' directory.

Demo Video Js

Demo Video Py

Usage:

Python:

#YOUR_QUERY.

Javascript:

//YOUR_QUERY.

(Note the dot ‘.’ at the end.)

Example:

Python:

# concat two dicts.

Javascript:

// merge two arrays.

Notes:

  1. The extension only supports python and javascript as of now and won't run on files not ending with '.py' or '.js'

Requirements

VSCode 1.59.0 or up.

Feedback/Contact:

If you spot any mistakes or any possible improvements, please feel free to let me know and contributions are welcome!

Form or sdpmas@live.unc.edu

Some of the code are adapted from following repositories:

  1. CodeSearchNet
  2. CodeXGLUE
  3. APPS