初始化项目,由ModelHub XC社区提供模型

Model: arvkevi/python-bytes-distilgpt2
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-26 13:25:13 +08:00
commit ebf740d679
21 changed files with 150636 additions and 0 deletions

32
.gitattributes vendored Normal file
View File

@@ -0,0 +1,32 @@
*.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
*.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
*.zstandard 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
View File

@@ -0,0 +1 @@
checkpoint-*/

64
README.md Normal file
View File

@@ -0,0 +1,64 @@
---
license: apache-2.0
tags:
- generated_from_trainer
metrics:
- accuracy
model-index:
- name: python-bytes-distilgpt2
results: []
widget:
- text: "fastAPI is a great new web framework to easily build web APIs."
example_title: "fastAPI"
- text: "The new tool uses sqlite for performance"
example_title: "sqlite"
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# python-bytes-distilgpt2
This model is not affiliated with the Python Bytes podcast in any way.
This model is a fine-tuned version of [distilgpt2](https://huggingface.co/distilgpt2) on [Python Bytes show notes](https://github.com/mikeckennedy/python_bytes_show_notes/tree/master/transcripts).
It achieves the following results on the evaluation set:
- Loss: 3.0372
- Accuracy: 0.3969
## Model description
This model generates conversation between the two show hosts (Michael Kennedy and Brian Okken), and sometimes guests appear :).
## Intended uses & limitations
This model was trained specifically for educational purposes and is intended for other users to use it in a similar manner.
## Training and evaluation data
Data is located [on GitHub](https://github.com/mikeckennedy/python_bytes_show_notes/tree/master/transcripts)
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 3.0
### Training results
### Framework versions
- Transformers 4.22.0.dev0
- Pytorch 1.12.0+cu113
- Datasets 2.4.0
- Tokenizers 0.12.1

15
all_results.json Normal file
View File

@@ -0,0 +1,15 @@
{
"epoch": 3.0,
"eval_accuracy": 0.39690118338084135,
"eval_loss": 3.037240505218506,
"eval_runtime": 31.7078,
"eval_samples": 1816,
"eval_samples_per_second": 57.273,
"eval_steps_per_second": 14.318,
"perplexity": 20.84763484705914,
"train_loss": 3.0642820732502996,
"train_runtime": 1709.0811,
"train_samples": 10112,
"train_samples_per_second": 17.75,
"train_steps_per_second": 4.437
}

46
config.json Normal file
View File

@@ -0,0 +1,46 @@
{
"_name_or_path": "distilgpt2",
"_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.0.dev0",
"use_cache": true,
"vocab_size": 50257
}

10
eval_results.json Normal file
View File

@@ -0,0 +1,10 @@
{
"epoch": 3.0,
"eval_accuracy": 0.39690118338084135,
"eval_loss": 3.037240505218506,
"eval_runtime": 31.7078,
"eval_samples": 1816,
"eval_samples_per_second": 57.273,
"eval_steps_per_second": 14.318,
"perplexity": 20.84763484705914
}

50001
merges.txt Normal file

File diff suppressed because it is too large Load Diff

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bda3efb9fe2a9570e12693db73a5d816b9c1b8dae9a7a832b72dad8c742e7f0c
size 333950664

3
pytorch_model.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa27a87af23c24c8d3d04c08faf5d4c14921973e5631ac03272ea0d497a789e4
size 333969117

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:048d89e7966c013196fea58b952a87152a424a3dacd409dd8ce2ca6bc092a40c
size 5421

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb4eac692114b7cf816451f7c5507ca32e1ea74797e6921d3347ca3cd1311d6c
size 4008

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d039d9f293f0f6ce75cd308f5418864e7bca5e059e3e9c348033076d42cd7850
size 5421

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4d1c1d418cc261bfa60172b71eebb342670ee171b75acbf7759cf1d602f10d27
size 6717

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4053d99e1b6776a65b620431a5216a9b7297a10f4738389f6a11a2965729af3d
size 363

5
special_tokens_map.json Normal file
View File

@@ -0,0 +1,5 @@
{
"bos_token": "<|endoftext|>",
"eos_token": "<|endoftext|>",
"unk_token": "<|endoftext|>"
}

100304
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

10
tokenizer_config.json Normal file
View File

@@ -0,0 +1,10 @@
{
"add_prefix_space": false,
"bos_token": "<|endoftext|>",
"eos_token": "<|endoftext|>",
"model_max_length": 1024,
"name_or_path": "distilgpt2",
"special_tokens_map_file": null,
"tokenizer_class": "GPT2Tokenizer",
"unk_token": "<|endoftext|>"
}

8
train_results.json Normal file
View File

@@ -0,0 +1,8 @@
{
"epoch": 3.0,
"train_loss": 3.0642820732502996,
"train_runtime": 1709.0811,
"train_samples": 10112,
"train_samples_per_second": 17.75,
"train_steps_per_second": 4.437
}

115
trainer_state.json Normal file
View File

@@ -0,0 +1,115 @@
{
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 3.0,
"global_step": 7584,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"epoch": 0.2,
"learning_rate": 4.6703586497890296e-05,
"loss": 3.3817,
"step": 500
},
{
"epoch": 0.4,
"learning_rate": 4.340717299578059e-05,
"loss": 3.2354,
"step": 1000
},
{
"epoch": 0.59,
"learning_rate": 4.011075949367088e-05,
"loss": 3.1946,
"step": 1500
},
{
"epoch": 0.79,
"learning_rate": 3.6814345991561184e-05,
"loss": 3.1541,
"step": 2000
},
{
"epoch": 0.99,
"learning_rate": 3.351793248945148e-05,
"loss": 3.1354,
"step": 2500
},
{
"epoch": 1.19,
"learning_rate": 3.0221518987341774e-05,
"loss": 3.0363,
"step": 3000
},
{
"epoch": 1.38,
"learning_rate": 2.6925105485232068e-05,
"loss": 3.0444,
"step": 3500
},
{
"epoch": 1.58,
"learning_rate": 2.3628691983122365e-05,
"loss": 3.0292,
"step": 4000
},
{
"epoch": 1.78,
"learning_rate": 2.033227848101266e-05,
"loss": 3.0086,
"step": 4500
},
{
"epoch": 1.98,
"learning_rate": 1.7035864978902955e-05,
"loss": 2.9992,
"step": 5000
},
{
"epoch": 2.18,
"learning_rate": 1.3739451476793249e-05,
"loss": 2.9701,
"step": 5500
},
{
"epoch": 2.37,
"learning_rate": 1.0443037974683544e-05,
"loss": 2.9505,
"step": 6000
},
{
"epoch": 2.57,
"learning_rate": 7.14662447257384e-06,
"loss": 2.9507,
"step": 6500
},
{
"epoch": 2.77,
"learning_rate": 3.850210970464136e-06,
"loss": 2.9395,
"step": 7000
},
{
"epoch": 2.97,
"learning_rate": 5.537974683544304e-07,
"loss": 2.9615,
"step": 7500
},
{
"epoch": 3.0,
"step": 7584,
"total_flos": 1981674556489728.0,
"train_loss": 3.0642820732502996,
"train_runtime": 1709.0811,
"train_samples_per_second": 17.75,
"train_steps_per_second": 4.437
}
],
"max_steps": 7584,
"num_train_epochs": 3,
"total_flos": 1981674556489728.0,
"trial_name": null,
"trial_params": null
}

3
training_args.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8cb569a94e5e9a63d5136ebe086c25b0ca8a7aafe8a60202124fd20a82f7f358
size 3311

1
vocab.json Normal file

File diff suppressed because one or more lines are too long