NofarSachs
commited on
Commit
•
e2fc6fe
1
Parent(s):
4ce416c
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,132 @@
|
|
1 |
-
---
|
2 |
-
license: ms-pl
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: ms-pl
|
3 |
+
---
|
4 |
+
# PhiMarketing: A Marketing Large Language Model
|
5 |
+
|
6 |
+
PhiMarketing is a 3.8B parameter Domain-Specific Large Language Model (LLM).
|
7 |
+
It was specifically adapted to the marketing domain from [Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct) through continuous pretraining on a meticulously curated and comprehensive marketing corpus of more than 43B tokens.
|
8 |
+
We are releasing this **early checkpoint** of the model to the AI community.
|
9 |
+
|
10 |
+
|
11 |
+
### Model Description
|
12 |
+
|
13 |
+
PhiMarketing is a powerful tool that can aid in generating high-quality marketing content and conducting research in the field of marketing.
|
14 |
+
It's a great resource for anyone looking to stay ahead in the rapidly changing world of marketing.
|
15 |
+
|
16 |
+
While the model is designed to encode marketing knowledge, this checkpoint is not yet adapted to deliver knowledge appropriately, safely, or within professional actionable constraints.
|
17 |
+
We recommend against deploying PhiMarketing in real-world practice settings.
|
18 |
+
|
19 |
+
### Model Details
|
20 |
+
- Developed by: [Marketeam](https://www.marketeam.ai/)
|
21 |
+
- Model type: Causal decoder-only transformer language model
|
22 |
+
- Continue-pretrained from model: Phi-3-mini-128k-instruct
|
23 |
+
- Context length: 3K tokens
|
24 |
+
- Input & Output: Text-only
|
25 |
+
- Language: English
|
26 |
+
- Knowledge Cutoff: December 2023
|
27 |
+
|
28 |
+
## Uses
|
29 |
+
|
30 |
+
PhiMarketing has been developed for further research of LLM for marketing applications.
|
31 |
+
The potential use cases for this tool are diverse and varied, ranging from marketing question answering to general marketing information queries, and actions (function-calls) on marketing platforms.
|
32 |
+
|
33 |
+
PhiMarketing is a Foundation Language Model (FLM) without finetuning or instruction-tuning.
|
34 |
+
We recommend applying SFT or RLHF-tuned for specific downstream tasks. Or rather apply in-context learning with 1000-1500 tokens added to the prompt.
|
35 |
+
|
36 |
+
|
37 |
+
## Training Details
|
38 |
+
|
39 |
+
### Training Data
|
40 |
+
|
41 |
+
Marketing data from publicly available and **internal** sources such as:
|
42 |
+
- Blogs
|
43 |
+
- Books
|
44 |
+
- Websites
|
45 |
+
- Podcasts
|
46 |
+
- Newsletters
|
47 |
+
- Publications
|
48 |
+
- Social Media
|
49 |
+
- Ad-Campaigns
|
50 |
+
- Landing Pages
|
51 |
+
- Press Releases
|
52 |
+
- Email-Campaigns
|
53 |
+
- Brochures & Flyers
|
54 |
+
- Product Description
|
55 |
+
- Testimonials & Reviews
|
56 |
+
- ...
|
57 |
+
And ±10% of previously seen data to avoid *catastrophic forgetting*.
|
58 |
+
|
59 |
+
|
60 |
+
### Training Procedure
|
61 |
+
|
62 |
+
Our training procedure includes using the AWS SageMaker framework, 4 NVIDIA A100 GPUs, p4de.24xlarge machine.
|
63 |
+
With a total train time of ±250 hours, with a total training cost of ±10K$.
|
64 |
+
This is an **early checkpoint** of the model that we are releasing to the community.
|
65 |
+
|
66 |
+
#### Training Hyperparameters
|
67 |
+
|
68 |
+
| Param | Value |
|
69 |
+
|---------------|------------|
|
70 |
+
| bf16 | true |
|
71 |
+
| tf32 | true |
|
72 |
+
| lr | 1e-4 |
|
73 |
+
| optim | adamw |
|
74 |
+
| epochs | 1 |
|
75 |
+
| lr scheduler | constant |
|
76 |
+
| warmup ratio | 0.03 |
|
77 |
+
| max grad norm | 0.3 |
|
78 |
+
| context len | 3072 |
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
## How to use
|
83 |
+
|
84 |
+
#### Using Transformers pipeline
|
85 |
+
|
86 |
+
```python
|
87 |
+
import transformers
|
88 |
+
import torch
|
89 |
+
|
90 |
+
model_id = "marketeam/PhiMarketing"
|
91 |
+
tokenizer_id = "microsoft/Phi-3-mini-128k-instruct"
|
92 |
+
token = "hf-token"
|
93 |
+
|
94 |
+
pipeline = transformers.pipeline("text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16},
|
95 |
+
tokenizer=tokenizer_id, token=token, device_map='auto')
|
96 |
+
|
97 |
+
pipeline("What are the key components of a digital marketing strategy?")
|
98 |
+
```
|
99 |
+
|
100 |
+
#### Using Transformers generate
|
101 |
+
|
102 |
+
```python
|
103 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
104 |
+
import torch
|
105 |
+
|
106 |
+
model_id = "marketeam/PhiMarketing"
|
107 |
+
tokenizer_id = "microsoft/Phi-3-mini-128k-instruct"
|
108 |
+
token = "hf_token"
|
109 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
110 |
+
|
111 |
+
tokenizer = AutoTokenizer.from_pretrained(tokenizer_id, token=token)
|
112 |
+
model = AutoModelForCausalLM.from_pretrained(
|
113 |
+
model_id, torch_dtype=torch.bfloat16, token=token,trust_remote_code=true).to(device)
|
114 |
+
|
115 |
+
message = "How do I calculate customer lifetime value?"
|
116 |
+
inputs = tokenizer(message, return_tensors="pt").to(device)
|
117 |
+
outputs = model.generate(**inputs)
|
118 |
+
tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
119 |
+
```
|
120 |
+
|
121 |
+
|
122 |
+
## Intended Usage
|
123 |
+
|
124 |
+
PhiMarketing is now available for further testing and assessment. Potential use cases include, but are not limited to:
|
125 |
+
- Text Generation: This model can produce creative text formats in the marketing domain.
|
126 |
+
- Knowledge Exploration: It can assist marketing researchers by generating valuable marketing information or answering questions about marketing-specific topics.
|
127 |
+
- Natural Language Processing (NLP) Research: This model can form the basis for researchers to experiment with NLP techniques, develop algorithms, and contribute to the advancement of the field.
|
128 |
+
|
129 |
+
|
130 |
+
## Contributers
|
131 |
+
|
132 |
+
[Sahar Millis](https://www.linkedin.com/in/sahar-millis/) [Coby Benveniste](https://www.linkedin.com/in/coby-benveniste/) [Nofar Sachs](https://www.linkedin.com/in/nofar-sachs-2146801b3/) [Eran Mazur](https://www.linkedin.com/in/eranmazur/)
|