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

Latest commit

 

History

History
35 lines (27 loc) · 838 Bytes

README.md

File metadata and controls

35 lines (27 loc) · 838 Bytes

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.