CoolFace
Modelpublic

Jayi2424/HumorGen_DPO_7B

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes147downloads
README.md79 linesDownload Raw Back to root
1---2language:3  - en4license: apache-2.05tags:6  - text-generation7  - humor8  - computational-humor9  - peft10  - lora11  - qwen12  - cognitive-synergy-framework13  - headline-humor14base_model: Qwen/Qwen2.5-7B-Instruct15pipeline_tag: text-generation16---17 18# HumorGen DPO — 7B19 20Part of the [HumorGen Collection](https://huggingface.co/collections/Jayi2424/humorgen) · SaLT Lab, Carnegie Mellon University21 22---23 24DPO fine-tune of HumorGen_SFT_7B. Preference pairs sourced from HumorRank Bradley-Terry pairwise evaluations.25 26**Paper(s):** [arXiv:2604.09629](https://arxiv.org/abs/2604.09629)27 28---29 30## Training31 32| Property | Value |33|:---|:---|34| Stage | Direct Preference Optimization (DPO) |35| Initialized from | HumorGen_SFT_7B |36| Backbone | Qwen2.5-7B-Instruct (QLoRA 4-bit) |37| Preference data | HumorRank pairwise tournament |38| Beta | 0.1 |39 40## Usage41 42This is a PEFT LoRA adapter. Load the base model and apply the adapter:43 44```python45from transformers import AutoModelForCausalLM, AutoTokenizer46from peft import PeftModel47import torch48 49tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")50model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", torch_dtype=torch.bfloat16, device_map="auto")51model = PeftModel.from_pretrained(model, "Jayi2424/HumorGen_DPO_7B")52 53headline = "Economists agree that everything is fine and you should stop asking"54prompt = (55    "<|im_start|>system\n"56    "You are a comedy writer. Write one sharp, witty joke for the headline.\n<|im_end|>\n"57    f"<|im_start|>user\n{headline}<|im_end|>\n"58    "<|im_start|>assistant\n"59)60inputs  = tokenizer(prompt, return_tensors="pt").to(model.device)61outputs = model.generate(**inputs, max_new_tokens=120, temperature=0.9, top_p=0.95)62print(tokenizer.decode(outputs[0], skip_special_tokens=True))63```64 65## Citation66 67```bibtex68@misc{ajayi2026humorgen,69  title         = {HumorGen: Cognitive Synergy for Humor Generation in Large Language70                   Models via Persona-Based Distillation},71  author        = {Ajayi, Edward and others},72  year          = {2026},73  eprint        = {2604.09629},74  archivePrefix = {arXiv},75  primaryClass  = {cs.CL},76  url           = {https://arxiv.org/abs/2604.09629}77}78```79