PolyWrap
This is just a small wrapper for running the PolyCoder model (paper) on some prompts with a variety of temperatures etc. Setup:
- Get the model and unpack it somewhere. You can find instructions in VHellendoorn's Code-LMs repository.
- Change
FASTDATA
inpolycoder.py
to match where you unpacked the model. pip install -r requirements.txt
Usage
$ python polycoder.py --help
usage: polycoder.py [-h] [-m MAX_TOKENS] [-n NUM_SAMPLES] [-p TOP_P]
[-t TEMPERATURE] [--num_gpus NUM_GPUS]
prompt_files [prompt_files ...]
positional arguments:
prompt_files Prompt files
optional arguments:
-h, --help show this help message and exit
-m MAX_TOKENS, --max_tokens MAX_TOKENS
Max number of tokens to generate (default: 512)
-n NUM_SAMPLES, --num_samples NUM_SAMPLES
Number of samples to generate per prompt (default: 10)
-p TOP_P, --top_p TOP_P
Top p (default: 0.0)
-t TEMPERATURE, --temperature TEMPERATURE
Temperature (default: 0.5)
--num_gpus NUM_GPUS Number of GPUs to use (default: autodetect)