Configuration Parsing Warning: In adapter_config.json: "peft.task_type" must be a string

Model Card for Simple Fine-Tune GPT2

Simple fine-tune of GPT2 using PEFT and TRL.

Model Details

Model Description

Model fine-tuned on a code generation dataset using PEFT and TRL.

  • Developed by: Bhargav N
  • Model type: GPT2
  • Language(s) (NLP): English
  • License: MIT
  • Finetuned from model [optional]: GPT2

base_model: gpt2 library_name: transformers model_name: '' tags: - generated_from_trainer - sft - trl licence: license

Model Card for

This model is a fine-tuned version of gpt2. It has been trained using TRL.

Quick start

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
from peft import PeftModel

base_model_id = "gpt2"
adapter_id = "bhargavcn/simple-finetuned-gpt2"

tokenizer = AutoTokenizer.from_pretrained(base_model_id)

base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.float16,
    device_map="auto"
)

model = PeftModel.from_pretrained(base_model, adapter_id)

pipe = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer
)

print(pipe("Explain reinforcement learning simply.", max_new_tokens=150)[0]["generated_text"])

Training procedure

This model was trained with SFT.

Framework versions

  • TRL: 0.29.0
  • Transformers: 5.2.0
  • Pytorch: 2.10.0
  • Datasets: 4.6.0
  • Tokenizers: 0.22.2

Citations

Cite TRL as:

@software{vonwerra2020trl,
  title   = {{TRL: Transformers Reinforcement Learning}},
  author  = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
  license = {Apache-2.0},
  url     = {https://github.com/huggingface/trl},
  year    = {2020}
}
Downloads last month
22
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for bhargavcn/simple-finetuned-gpt2

Adapter
(1672)
this model