初始化项目,由ModelHub XC社区提供模型
Model: postbot/distilgpt2-emailgen-V2 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:
|
||||||
|
- generated_from_trainer
|
||||||
|
- distilgpt2
|
||||||
|
- 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: 4
|
||||||
|
max_length: 128
|
||||||
|
length_penalty: 0.8
|
||||||
|
no_repeat_ngram_size: 2
|
||||||
|
do_sample: False
|
||||||
|
num_beams: 8
|
||||||
|
early_stopping: True
|
||||||
|
repetition_penalty: 5.5
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
# distilgpt2-emailgen: V2
|
||||||
|
|
||||||
|
|
||||||
|
[](https://colab.research.google.com/gist/pszemraj/d1c2d88b6120cca4ca7df078ea1d1e50/scratchpad.ipynb)
|
||||||
|
|
||||||
|
Why write the rest of your email when you can generate it?
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import pipeline
|
||||||
|
|
||||||
|
model_tag = "postbot/distilgpt2-emailgen-V2"
|
||||||
|
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'])
|
||||||
|
```
|
||||||
|
|
||||||
|
## Model description
|
||||||
|
|
||||||
|
This model is a fine-tuned version of `distilgpt2` on the postbot/multi-emails-100k dataset.
|
||||||
|
It achieves the following results on the evaluation set:
|
||||||
|
- Loss: 1.9126
|
||||||
|
|
||||||
|
|
||||||
|
## Intended uses & limitations
|
||||||
|
|
||||||
|
More information needed
|
||||||
|
|
||||||
|
## Training and evaluation data
|
||||||
|
|
||||||
|
More information needed
|
||||||
|
|
||||||
|
## Training procedure
|
||||||
|
|
||||||
|
### Training hyperparameters (run 1/2)
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
### Training hyperparameters (run 2/2)
|
||||||
|
|
||||||
|
The following hyperparameters were used during training:
|
||||||
|
- learning_rate: 0.0006
|
||||||
|
- 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.01
|
||||||
|
- num_epochs: 4
|
||||||
|
|
||||||
|
### Training results
|
||||||
|
|
||||||
|
| Training Loss | Epoch | Step | Validation Loss |
|
||||||
|
|:-------------:|:-----:|:----:|:---------------:|
|
||||||
|
| 1.9045 | 1.0 | 789 | 2.0006 |
|
||||||
|
| 1.8115 | 2.0 | 1578 | 1.9557 |
|
||||||
|
| 1.8501 | 3.0 | 2367 | 1.9110 |
|
||||||
|
| 1.7376 | 4.0 | 3156 | 1.9126 |
|
||||||
|
|
||||||
|
|
||||||
|
### 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__distilgpt2-emailgen-V2)
|
||||||
|
|
||||||
|
| Metric | Value |
|
||||||
|
|-----------------------|---------------------------|
|
||||||
|
| Avg. | 24.59 |
|
||||||
|
| ARC (25-shot) | 20.99 |
|
||||||
|
| HellaSwag (10-shot) | 26.78 |
|
||||||
|
| MMLU (5-shot) | 25.53 |
|
||||||
|
| TruthfulQA (0-shot) | 46.51 |
|
||||||
|
| Winogrande (5-shot) | 52.01 |
|
||||||
|
| GSM8K (5-shot) | 0.0 |
|
||||||
|
| DROP (3-shot) | 0.31 |
|
||||||
46
config.json
Normal file
46
config.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "postbot/distilgpt2-emailgen-V2",
|
||||||
|
"_num_labels": 1,
|
||||||
|
"activation_function": "gelu_new",
|
||||||
|
"architectures": [
|
||||||
|
"GPT2LMHeadModel"
|
||||||
|
],
|
||||||
|
"attn_pdrop": 0.1,
|
||||||
|
"bos_token_id": 50256,
|
||||||
|
"embd_pdrop": 0.1,
|
||||||
|
"eos_token_id": 50256,
|
||||||
|
"id2label": {
|
||||||
|
"0": "LABEL_0"
|
||||||
|
},
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"label2id": {
|
||||||
|
"LABEL_0": 0
|
||||||
|
},
|
||||||
|
"layer_norm_epsilon": 1e-05,
|
||||||
|
"model_type": "gpt2",
|
||||||
|
"n_ctx": 1024,
|
||||||
|
"n_embd": 768,
|
||||||
|
"n_head": 12,
|
||||||
|
"n_inner": null,
|
||||||
|
"n_layer": 6,
|
||||||
|
"n_positions": 1024,
|
||||||
|
"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:e41e37b0d86c3856618a94fb174c448dff198936bc5c0f6da845a7a2c2a8f870
|
||||||
|
size 483326338
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:490a20060fbee58abf38c6e0fc1e075bf00016bcf42cd65f5986b1fb14e57657
|
||||||
|
size 333950622
|
||||||
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:5f564a5fc55c8e20acf4d8195073ee3c5a0ce012ab28beb9c5bdf357fa1b26b7
|
||||||
|
size 333969117
|
||||||
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": "postbot/distilgpt2-emailgen-V2",
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
3843
trainer_state.json
Normal file
3843
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:d55d1b578701be043c5e54f68e065520d66dee6b2f36f998afd658361f854c85
|
||||||
|
size 3631
|
||||||
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