save_generated_texts

Description

The save_generated_texts function saves the generated texts along with their corresponding prompts to a pickle file. This is useful for later retrieval or further analysis of the outputs.

Arguments

  • generated_texts (list of str): The texts generated by the model.

  • prompts (list of str): The list of prompts corresponding to the generated texts.

  • save_name (str): The base filename (without extension) to use when saving the pickle file.

Returns

  • None: Saves the texts to a file named <save_name>.pkl and does not return a value.

Example Usage

from gpi_pack.llm import save_generated_texts

generated_texts = ["Text generated from prompt 1", "Text generated from prompt 2"]
prompts = ["Prompt 1", "Prompt 2"]

# Save the texts into "output.pkl"
save_generated_texts(generated_texts, prompts, "output")