andreasjansson/codegen 🔢📝✓ → ❓

▶️ 1.2K runs 📅 May 2022 ⚙️ Cog 0.3.3 🔗 GitHub 📄 Paper ⚖️ License
code-completion code-generation python text-generation

About

An open-source model for program synthesis. Competitive with OpenAI Codex.

Example Output

Output

{"markdown":"https://replicate.delivery/mgxm/301f4cfa-290d-43bf-82b3-b1c536acb891/prediction.markdown"}

Performance Metrics

235.47s Prediction Time
616.83s Total Time
All Input Parameters
{
  "seed": -1,
  "top_p": 0.95,
  "context": "# Implement a function that computes the square of an integer argument.\n",
  "max_length": 128,
  "temperature": 0.2,
  "prepend_imports": true,
  "num_return_sequences": "4",
  "prepend_context_to_output": true
}
Input Parameters
seed Type: integerDefault: -1
Seed for reproducibility. Use -1 for a random seed.
top_p Type: numberDefault: 0.95Range: 0 - 1
Top-p sampling probability.
context Type: stringDefault: # Implement a function that computes the square of an integer argument.
Some starting python code. CodeGen will try to complete the code provided. Providing examples of what you want to do before your prompt can improve performance.
max_length Type: integerDefault: 128Range: 32 - 2048
Max length of returned sequences.
raw_output Type: booleanDefault: false
Whether to return a long string (multiple code snippets separated by the string `======`) or a markdown url to be downloaded. May find useful for api.
temperature Type: numberDefault: 0.2Range: 0 - 1
Increase to improve diversity of outputs, may cause artifacts.
prepend_imports Type: booleanDefault: true
Whether to prepend a numpy import to the context as in the paper.
num_return_sequences Type: integerDefault: 1Range: 1 - 10
Number of code completions to generate from context.
prepend_context_to_output Type: booleanDefault: true
Whether to prepend your input to the output.
Output Schema

Output

Example Execution Logs
Set seed 745184440
Prepending numpy import snippet to context
Generating code completion
=====


```py
# sequence 1/4
# import libraries

import numpy as np

# Implement a function that computes the square of an integer argument.
def square(x):
    return x**2
```
```py
# sequence 2/4
# import libraries

import numpy as np

# Implement a function that computes the square of an integer argument.
def square(x):
    return x**2
```
```py
# sequence 3/4
# import libraries

import numpy as np

# Implement a function that computes the square of an integer argument.
def square(x):
    return x**2
```
```py
# sequence 4/4
# import libraries

import numpy as np

# Implement a function that computes the square of an integer argument.
def square(x):
    return x**2
```


=====
Generating code completion took 1.16s
Version Details
Version ID
211bde4f1da227ce567f2db0fe3811d27435f69b3ac1c37237f3272fa1e79820
Version Created
May 24, 2022
Run on Replicate →