MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / format_alpaca

Function format_alpaca

examples/cpu/cpu_training.py:63–70  ·  view source on GitHub ↗
(example)

Source from the content-addressed store, hash-verified

61
62
63def format_alpaca(example):
64 if example.get("input", ""):
65 return (
66 f"### Instruction:\n{example['instruction']}\n\n"
67 f"### Input:\n{example['input']}\n\n"
68 f"### Response:\n{example['output']}"
69 )
70 return f"### Instruction:\n{example['instruction']}\n\n### Response:\n{example['output']}"
71
72
73def prepare_data(tokenizer, dataset_name, max_length, num_samples=200):

Callers 1

tokenizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected