andreasjansson/codegen 🔢📝✓ → ❓
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
- Seed for reproducibility. Use -1 for a random seed.
- top_p
- Top-p sampling probability.
- context
- 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
- Max length of returned sequences.
- raw_output
- 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
- Increase to improve diversity of outputs, may cause artifacts.
- prepend_imports
- Whether to prepend a numpy import to the context as in the paper.
- num_return_sequences
- Number of code completions to generate from context.
- prepend_context_to_output
- 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