--- library_name: transformers tags: - text-generation - ad-generation - marketing - transformers - pytorch - beam-search --- # ๐Ÿงƒ Model Card: Ad Generator for Marketing Copy This is a fine-tuned version of Microsoft's [`phi-2`](https://huggingface.co/microsoft/phi-2) language model, adapted for generating high-quality marketing content such as ad copy, slogans, and promotional text. It uses prompt-response training to structure outputs fluently and persuasively. ## Model Details ### Model Description A fine-tuned Causal Language Model (CLM) based on `microsoft/phi-2`, optimized to produce structured marketing text with consistent formatting and clarity. - **Developed by:** Adnane Touiyate - **Shared by :** [Adnane10](https://huggingface.co/Adnane10) - **Model type:** Causal Language Model (phi-2) - **Language(s):** English - **License:** MIT - **Finetuned from model:** microsoft/phi-2 ## Uses ### โœ… Direct Use Marketing teams can input a product name and short description to generate ad copy Copywriters seeking inspiration or quick content drafts Startup founders, product teams, or solopreneurs generating headlines and taglines ### ๐Ÿšซ Out-of-Scope Use Not intended for factual, academic, or scientific content generation Not suitable for generating personal, sensitive, or confidential information May not generalize well to domains outside of marketing or product promotion ## โš ๏ธ Bias, Risks, and Limitations While the model generates fluent and persuasive marketing text, it may: Include overly generic, exaggerated, or unverifiable claims Mimic clichรฉs or stereotypes from marketing-focused training data Lack fact-checking for health-related, numerical, or product safety statements ### ๐Ÿ” Recommendations Use human review and editing before publishing outputs Consider further fine-tuning the model on your brand voice, domain, or regulatory constraints if needed ## ๐Ÿš€ How to Get Started with the Model ```python from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Adnane10/AdsGeniusAI") model = AutoModelForCausalLM.from_pretrained("Adnane10/AdsGeniusAI") prompt = "Create an ad for a vegan skincare brand that emphasizes natural ingredients and sustainability." inputs = tokenizer(prompt, return_tensors='pt').to('cuda') output = model.generate(**inputs, max_length=256, num_beams=5, temperature=0.7) print(tokenizer.decode(output[0], skip_special_tokens=True)) ``` ## ๐Ÿ“Š Training Details ### Training Data Fine-tuned on a dataset of curated product advertisements and promotional templates, covering sectors such as: Food & Beverage Tech & Gadgets Beauty & Skincare Fitness & Wellness ### Training Procedure Precision: fp16 mixed precision Quantization: 4-bit (nf4) using BitsAndBytes Optimizer: AdamW Scheduler: Linear warmup + cosine decay Epochs: 3โ€“6 (early stopping used) Framework: Hugging Face transformers, peft, accelerate, and bitsandbytes ## ๐Ÿ“ˆ Evaluation Metrics BLEU / ROUGE: For structural and surface evaluation Human Evaluation: Based on fluency, creativity, and relevance Manual Checks: On repetition and prompt adherence ## ๐ŸŒฑ Environmental Impact Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). - **Hardware Type:** NVIDIA Tesla T4 - **Hours used:** ~2 hours - **Cloud Provider:** Kaggle - **Estimated Carbon Emission:** < 0.5 kg COโ‚‚ ## ๐Ÿ”ง Technical Specifications - **Base Model:** `microsoft/phi-2` (~2.7B parameters) - **Tokenizer:** `AutoTokenizer` from `phi-2` - **Quantization:** 4-bit (NF4 with FP16 compute) **Libraries Used:** - `transformers` - `peft` - `accelerate` - `bitsandbytes` ### Model Architecture and Objective The model is based on Microsoftโ€™s `phi-2`, a small-scale language model focused on reasoning and general-purpose NLP tasks. It was fine-tuned as a Causal Language Model (CLM) to generate high-quality, structured advertising copy using prompt-response style formatting. Quantized to 4-bit using `bitsandbytes` for efficiency. ## ๐Ÿ“š Citation [optional] @misc{freshpress-adgen, title={FreshPress Ad Generator}, author={Adnane Touiyate}, year={2025}, url={https://huggingface.co/Adnane10/phi2-marketing-generator}, note={Fine-tuned Phi-2 model for marketing and ad copy generation} } ## โœ๏ธ Model Card Authors **Adnane Touiyate** ([@Adnane10](https://huggingface.co/Adnane10)) ## ๐Ÿ“ฌ Contact For questions or collaborations, reach out via [LinkedIn](https://www.linkedin.com/in/adnanetouiyate/) or email: [adnanetouiayte11@gmail.com](mailto:adnanetouiayte11@gmail.com)