初始化项目,由ModelHub XC社区提供模型
Model: postbot/gpt2-medium-emailgen Source: Original Platform
This commit is contained in:
33
.gitattributes
vendored
Normal file
33
.gitattributes
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
checkpoint-*/
|
||||||
144
README.md
Normal file
144
README.md
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
---
|
||||||
|
license:
|
||||||
|
- apache-2.0
|
||||||
|
tags:
|
||||||
|
- text generation
|
||||||
|
- emailgen
|
||||||
|
- email generation
|
||||||
|
- email
|
||||||
|
datasets:
|
||||||
|
- aeslc
|
||||||
|
- postbot/multi-emails-100k
|
||||||
|
|
||||||
|
widget:
|
||||||
|
- text: "Good Morning Professor Beans,
|
||||||
|
|
||||||
|
Hope you are doing well. I just wanted to reach out and ask if differential calculus will be on the exam"
|
||||||
|
example_title: "email to prof"
|
||||||
|
- text: "Hey <NAME>,\n\nThank you for signing up for my weekly newsletter. Before we get started, you'll have to confirm your email address."
|
||||||
|
example_title: "newsletter"
|
||||||
|
- text: "Hi <NAME>,\n\nI hope this email finds you well. I wanted to reach out and ask about office hours"
|
||||||
|
example_title: "office hours"
|
||||||
|
- text: "Greetings <NAME>,\n\nI hope you had a splendid evening at the Company sausage eating festival. I am reaching out because"
|
||||||
|
example_title: "festival"
|
||||||
|
- text: "Good Morning Harold,\n\nI was wondering when the next"
|
||||||
|
example_title: "event"
|
||||||
|
- text: "URGENT - I need the TPS reports"
|
||||||
|
example_title: "URGENT"
|
||||||
|
- text: "Hi Archibald,\n\nI hope this email finds you extremely well."
|
||||||
|
example_title: "emails that find you"
|
||||||
|
- text: "Hello there.\n\nI just wanted to reach out and check in to"
|
||||||
|
example_title: "checking in"
|
||||||
|
- text: "Hello <NAME>,\n\nI hope this email finds you well. I wanted to reach out and see if you've enjoyed your time with us"
|
||||||
|
example_title: "work well"
|
||||||
|
- text: "Hi <NAME>,\n\nI hope this email finds you well. I wanted to reach out and see if we could catch up"
|
||||||
|
example_title: "catch up"
|
||||||
|
- text: "I'm <NAME> and I just moved into the area and wanted to reach out and get some details on where I could get groceries and"
|
||||||
|
example_title: "grocery"
|
||||||
|
parameters:
|
||||||
|
min_length: 32
|
||||||
|
max_length: 128
|
||||||
|
no_repeat_ngram_size: 2
|
||||||
|
do_sample: True
|
||||||
|
temperature: 0.3
|
||||||
|
top_k: 20
|
||||||
|
top_p: 0.95
|
||||||
|
repetition_penalty: 3.5
|
||||||
|
length_penalty: 0.9
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
# gpt2-medium-emailgen
|
||||||
|
|
||||||
|
[](https://colab.research.google.com/gist/pszemraj/70058788c6d4b430398c12ee8ba10602/minimal-demo-for-postbot-gpt2-medium-emailgen.ipynb
|
||||||
|
)
|
||||||
|
|
||||||
|
Why write the entire email when you can generate (most of) it?
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import pipeline
|
||||||
|
|
||||||
|
model_tag = "postbot/gpt2-medium-emailgen"
|
||||||
|
generator = pipeline(
|
||||||
|
'text-generation',
|
||||||
|
model=model_tag,
|
||||||
|
)
|
||||||
|
|
||||||
|
prompt = """
|
||||||
|
Hello,
|
||||||
|
|
||||||
|
Following up on the bubblegum shipment."""
|
||||||
|
|
||||||
|
result = generator(
|
||||||
|
prompt,
|
||||||
|
max_length=64,
|
||||||
|
do_sample=False,
|
||||||
|
early_stopping=True,
|
||||||
|
) # generate
|
||||||
|
print(result[0]['generated_text'])
|
||||||
|
```
|
||||||
|
|
||||||
|
## about
|
||||||
|
|
||||||
|
This model is a fine-tuned version of [gpt2-medium](https://huggingface.co/gpt2-medium) on the postbot/multi-emails-100k dataset.
|
||||||
|
It achieves the following results on the evaluation set:
|
||||||
|
- Loss: 1.5840
|
||||||
|
|
||||||
|
## Model description
|
||||||
|
|
||||||
|
More information needed
|
||||||
|
|
||||||
|
## Intended uses & limitations
|
||||||
|
|
||||||
|
- this is intended as a tool to save time writing predictable emails and not to write emails without a human-in-the-loop. validate that your email is factually correct before sending it to others.
|
||||||
|
|
||||||
|
## Training and evaluation data
|
||||||
|
|
||||||
|
- the dataset is essentially a hand-curated/augmented expansion to the classic `aeslc` dataset
|
||||||
|
|
||||||
|
## Training procedure
|
||||||
|
|
||||||
|
### Training hyperparameters
|
||||||
|
|
||||||
|
The following hyperparameters were used during training:
|
||||||
|
- learning_rate: 0.001
|
||||||
|
- train_batch_size: 16
|
||||||
|
- eval_batch_size: 16
|
||||||
|
- seed: 42
|
||||||
|
- distributed_type: multi-GPU
|
||||||
|
- gradient_accumulation_steps: 8
|
||||||
|
- total_train_batch_size: 128
|
||||||
|
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
||||||
|
- lr_scheduler_type: cosine
|
||||||
|
- lr_scheduler_warmup_ratio: 0.02
|
||||||
|
- num_epochs: 3
|
||||||
|
|
||||||
|
### Training results
|
||||||
|
|
||||||
|
| Training Loss | Epoch | Step | Validation Loss |
|
||||||
|
|:-------------:|:-----:|:----:|:---------------:|
|
||||||
|
| 1.8701 | 1.0 | 789 | 1.8378 |
|
||||||
|
| 1.5065 | 2.0 | 1578 | 1.6176 |
|
||||||
|
| 1.1873 | 3.0 | 2367 | 1.5840 |
|
||||||
|
|
||||||
|
|
||||||
|
### Framework versions
|
||||||
|
|
||||||
|
- Transformers 4.22.2
|
||||||
|
- Pytorch 1.10.0+cu113
|
||||||
|
- Datasets 2.5.1
|
||||||
|
- Tokenizers 0.12.1
|
||||||
|
|
||||||
|
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
||||||
|
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_postbot__gpt2-medium-emailgen)
|
||||||
|
|
||||||
|
| Metric | Value |
|
||||||
|
|-----------------------|---------------------------|
|
||||||
|
| Avg. | 25.97 |
|
||||||
|
| ARC (25-shot) | 26.45 |
|
||||||
|
| HellaSwag (10-shot) | 34.31 |
|
||||||
|
| MMLU (5-shot) | 24.1 |
|
||||||
|
| TruthfulQA (0-shot) | 43.96 |
|
||||||
|
| Winogrande (5-shot) | 50.43 |
|
||||||
|
| GSM8K (5-shot) | 0.0 |
|
||||||
|
| DROP (3-shot) | 2.53 |
|
||||||
41
config.json
Normal file
41
config.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "gpt2-medium",
|
||||||
|
"activation_function": "gelu_new",
|
||||||
|
"architectures": [
|
||||||
|
"GPT2LMHeadModel"
|
||||||
|
],
|
||||||
|
"attn_pdrop": 0.1,
|
||||||
|
"bos_token_id": 50256,
|
||||||
|
"embd_pdrop": 0.1,
|
||||||
|
"eos_token_id": 50256,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"layer_norm_epsilon": 1e-05,
|
||||||
|
"model_type": "gpt2",
|
||||||
|
"n_ctx": 1024,
|
||||||
|
"n_embd": 1024,
|
||||||
|
"n_head": 16,
|
||||||
|
"n_inner": null,
|
||||||
|
"n_layer": 24,
|
||||||
|
"n_positions": 1024,
|
||||||
|
"n_special": 0,
|
||||||
|
"predict_special_tokens": true,
|
||||||
|
"reorder_and_upcast_attn": false,
|
||||||
|
"resid_pdrop": 0.1,
|
||||||
|
"scale_attn_by_inverse_layer_idx": false,
|
||||||
|
"scale_attn_weights": true,
|
||||||
|
"summary_activation": null,
|
||||||
|
"summary_first_dropout": 0.1,
|
||||||
|
"summary_proj_to_labels": true,
|
||||||
|
"summary_type": "cls_index",
|
||||||
|
"summary_use_proj": true,
|
||||||
|
"task_specific_params": {
|
||||||
|
"text-generation": {
|
||||||
|
"do_sample": true,
|
||||||
|
"max_length": 50
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"torch_dtype": "float32",
|
||||||
|
"transformers_version": "4.22.2",
|
||||||
|
"use_cache": false,
|
||||||
|
"vocab_size": 50257
|
||||||
|
}
|
||||||
50001
merges.txt
Normal file
50001
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
model.onnx
Normal file
3
model.onnx
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d1527696d21c78c41e7df811680416fd7bd5a120b41e1a483b34a89e61b5538c
|
||||||
|
size 1627132305
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a6db922d97ba9093668beac61b97f5f1d0284764fae242d0581b77cedddda5b2
|
||||||
|
size 1444493752
|
||||||
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c96bfc8f0d48bcfdb8c6eaa8bad49bb0ecf584b28fa6feccdbc6c141a3c4945a
|
||||||
|
size 1444566873
|
||||||
24
special_tokens_map.json
Normal file
24
special_tokens_map.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<|endoftext|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "<|endoftext|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": "<|endoftext|>",
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<|endoftext|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
34
tokenizer_config.json
Normal file
34
tokenizer_config.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"add_bos_token": false,
|
||||||
|
"add_prefix_space": false,
|
||||||
|
"bos_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<|endoftext|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<|endoftext|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"errors": "replace",
|
||||||
|
"model_max_length": 1024,
|
||||||
|
"name_or_path": "gpt2-medium",
|
||||||
|
"pad_token": null,
|
||||||
|
"special_tokens_map_file": null,
|
||||||
|
"tokenizer_class": "GPT2Tokenizer",
|
||||||
|
"unk_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<|endoftext|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
2887
trainer_state.json
Normal file
2887
trainer_state.json
Normal file
File diff suppressed because it is too large
Load Diff
3
training_args.bin
Normal file
3
training_args.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:8b1c6f55cc5ce9c3968ab93367e8864fd942687d4c5120a4cba47bd5b9498bb4
|
||||||
|
size 3567
|
||||||
50259
vocab.json
Normal file
50259
vocab.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user