Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

smallcloudai/code-scratchpads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Scratchpads

This code converts high level code completion calls to low level prompts and converts result back. This is useful for many IDE plugins (VS Code, JB) as a common code that handles the low level.

Usage

Simple example:

curl http://127.0.0.1:8001/v1/code-completion -k \
  -H 'Content-Type: application/json' \
  -d '{
  "inputs": {
    "sources": {"hello.py": "def hello_world():"},
    "cursor": {
      "file": "hello.py",
      "line": 0,
      "character": 18
    },
    "multiline": true
  },
  "model": "bigcode/starcoder",
  "stream": false,
  "parameters": {
    "temperature": 0.1,
    "max_new_tokens": 20
  }
}'

Output is [{"code_completion": "\n return \"Hello World!\"\n"}].

To check out more examples, look at code_scratchpads/tests/test_api.py.