You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--restart Restart generation from scratch (default: False)
18
+
--cache CACHE JSONL file to cache intermediate results in. Will be restored from if it already exists and --restart is not specified
19
+
--restore_from RESTORE_FROM
20
+
JSON file to restore old results from. Will be restored from if it already exists and --restart is not specified. Is different from --cache in that it is a JSON
21
+
file, not a JSONL file, and it is only used to restore old results where the prompt is equivalent. Cached results are prioritized over restored results.
22
+
--max_new_tokens MAX_NEW_TOKENS
23
+
Maximum number of new tokens to generate (default: 1024)
24
+
--num_samples_per_prompt NUM_SAMPLES_PER_PROMPT
25
+
Number of code samples to generate (default: 50)
26
+
--temperature TEMPERATURE
27
+
Temperature for controlling randomness (default: 0.2)
28
+
--top_p TOP_P Top p value for nucleus sampling (default: 0.95)
29
+
--do_sample Enable sampling (default: False)
30
+
--batch_size BATCH_SIZE
31
+
Batch size for generation (default: 8)
32
+
--prompted Use prompted generation. See StarCoder paper (default: False)
33
+
```
34
+
35
+
To get outputs in a reasonable amount of time you will most likely need to run
36
+
this script on a system with a GPU available. There are the `generate-openai.py`
37
+
and `generate-gemini.py` scripts for generating outputs from the respective
38
+
APIs. These will require you to set the API keys in environment variables or
39
+
pass them as arguments. Use `--help` to see the arguments available.
40
+
41
+
The `--model` argument in`generate.py` can either be a local model path or the
42
+
handle of a HuggingFace model. The cache and restart arguments can be used to
43
+
restart from existing outputs. The `--prompted` flag will append _solution_
44
+
comments to the front of the prompt as in the StarCoder paper. You likely want
45
+
this turned on as it almost always improves the results.
46
+
47
+
## Adding New LLMs
48
+
49
+
Since a number of the LLMs have different inference settings and prompt formats,
50
+
we utilize an inference configuration abstraction to set these parameters for
51
+
different models. These are defined in`utils.py`. To add support for a new LLM
52
+
you will need to define an inference config forthat LLMin`utils.py`. The
53
+
existing examples in that file should suffice as examples.
54
+
55
+
## Translate Tests
56
+
57
+
Each of the generate scripts has a translation equivalent. These are used for
0 commit comments