Generate#

class composer.callbacks.Generate(prompts, interval, batch_size=None, **kwargs)[source]#

Periodically log generations from a set of prompts.

Parameters
  • prompts (list[str]) โ€“ The list of prompts you would like to produce generations for

  • interval (Union[str, int, Time]) โ€“ The interval describing how often checkpoints should be saved. If an integer, it will be assumed to be in TimeUnit.EPOCH. Otherwise, the unit must be either TimeUnit.EPOCH, TimeUnit.BATCH, TimeUnit.TOKEN, or TimeUnit.SAMPLE.

  • batch_size (Optional[int]) โ€“ Size of a prompt batch for generation. If None, defaults to the number of prompts.

  • kwargs โ€“ All kwargs will be passed along to the call to generate. This is for things like do_sample, top_p, etc