Prepare the text from a sample of the dataset.
(example, input_column_name="prompt", output_column_name="completion")
| 122 | |
| 123 | |
| 124 | def prepare_sample_text(example, input_column_name="prompt", output_column_name="completion"): |
| 125 | """Prepare the text from a sample of the dataset.""" |
| 126 | text = f"Question: {example[input_column_name]}\n\nAnswer: {example[output_column_name]}" |
| 127 | return text |
| 128 | |
| 129 | |
| 130 | class ConstantLengthDataset(IterableDataset): |
no outgoing calls
no test coverage detected