File size: 4,903 Bytes
592ea99
 
9ec51f4
 
 
 
 
 
 
592ea99
 
 
9ec51f4
592ea99
9ec51f4
592ea99
 
 
 
 
 
9ec51f4
592ea99
9ec51f4
 
 
 
 
 
592ea99
 
 
9ec51f4
592ea99
9ec51f4
 
 
592ea99
9ec51f4
592ea99
9ec51f4
 
 
592ea99
9ec51f4
592ea99
9ec51f4
592ea99
9ec51f4
 
 
592ea99
9ec51f4
592ea99
9ec51f4
 
592ea99
9ec51f4
592ea99
9ec51f4
 
592ea99
9ec51f4
 
592ea99
9ec51f4
 
 
 
 
592ea99
9ec51f4
592ea99
 
 
9ec51f4
592ea99
9ec51f4
 
 
 
592ea99
 
 
9ec51f4
 
 
 
 
 
592ea99
9ec51f4
592ea99
9ec51f4
592ea99
9ec51f4
 
 
592ea99
9ec51f4
592ea99
 
 
 
 
9ec51f4
 
 
 
592ea99
9ec51f4
592ea99
 
9ec51f4
 
 
592ea99
9ec51f4
 
 
 
 
592ea99
9ec51f4
 
592ea99
9ec51f4
592ea99
9ec51f4
 
 
 
 
 
 
592ea99
 
9ec51f4
592ea99
9ec51f4
592ea99
9ec51f4
592ea99
9ec51f4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
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

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

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)