gendataGUI

Attributes

device

iface

Functions

generateGUI_from_original_model(prompt[, temperature, ...])

Generates text based on a given prompt using an existing pre-trained model.

generateGUI_from_MC_aligned_model(prompt, ...)

Generates text using a Monte Carlo aligned model, adjusting output based on lambda-weighted rewards.

Module Contents

gendataGUI.device
gendataGUI.generateGUI_from_original_model(prompt, temperature=1.0, top_k=50, num_beams=1, max_new_tokens=50)

Generates text based on a given prompt using an existing pre-trained model.

Parameters:
  • prompt (str) – Input text prompt to generate continuation.

  • temperature (float, optional) – Sampling temperature for text generation. Defaults to 1.0.

  • top_k (int, optional) – Limits the number of high-probability tokens to sample from. Defaults to 50.

  • num_beams (int, optional) – Number of beams for beam search. Defaults to 1.

  • max_new_tokens (int, optional) – Maximum number of new tokens to generate. Defaults to 50.

Returns:

Generated text based on the input prompt.

Return type:

str

gendataGUI.generateGUI_from_MC_aligned_model(prompt, model_choice, value_list, lam_list, MC_nsamples, temperature, top_k, num_beams, max_new_tokens)

Generates text using a Monte Carlo aligned model, adjusting output based on lambda-weighted rewards.

Parameters:
  • prompt (str) – Input text prompt for generation.

  • model_choice (str) – Indicates whether to use the original or aligned model.

  • value_list (str) – Comma-separated values indicating alignment criteria.

  • lam_list (str) – Comma-separated lambda values for reward weighting.

  • MC_nsamples (int, optional) – Number of Monte Carlo samples for each prompt.

  • temperature (float, optional) – Sampling temperature for text generation.

  • top_k (int, optional) – Limits the number of high-probability tokens to sample from.

  • num_beams (int, optional) – Number of beams for beam search.

  • max_new_tokens (int, optional) – Maximum number of new tokens to generate.

Returns:

Selected generated text based on alignment.

Return type:

str

gendataGUI.iface