You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A complete implementation for fine-tuning GPT-2 (355M parameter version) on custom instruction-following tasks. The model is trained to understand structured prompts and generate appropriate responses.
{
"instruction": "Convert to passive voice",
"input": "The chef cooks the meal",
"output": "The meal is cooked by the chef"
}
🛠 Custom preprocessing:
defformat_input(entry):
base="Below is an instruction...\\n### Instruction:\\n{instruction}"returnbase+ (f"\\n### Input:\\n{entry['input']}"ifentry["input"] else"")