MCPcopy
hub / github.com/bigcode-project/starcoder / prepare_sample_text

Function prepare_sample_text

finetune/finetune.py:124–127  ·  view source on GitHub ↗

Prepare the text from a sample of the dataset.

(example, input_column_name="prompt", output_column_name="completion")

Source from the content-addressed store, hash-verified

122
123
124def 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
130class ConstantLengthDataset(IterableDataset):

Callers 2

chars_token_ratioFunction · 0.85
__iter__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected