Commit
·
854e925
1
Parent(s):
ba7197e
huggingartists
Browse files- README.md +97 -0
- config.json +41 -0
- evaluation.txt +1 -0
- flax_model.msgpack +3 -0
- merges.txt +0 -0
- optimizer.pt +3 -0
- pytorch_model.bin +3 -0
- rng_state.pth +3 -0
- scheduler.pt +3 -0
- special_tokens_map.json +1 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- trainer_state.json +90 -0
- training_args.bin +3 -0
- vocab.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
datasets:
|
| 4 |
+
- huggingartists/cardi-b
|
| 5 |
+
tags:
|
| 6 |
+
- huggingartists
|
| 7 |
+
- lyrics
|
| 8 |
+
- lm-head
|
| 9 |
+
- causal-lm
|
| 10 |
+
widget:
|
| 11 |
+
- text: "I am"
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
<div class="inline-flex flex-col" style="line-height: 1.5;">
|
| 15 |
+
<div class="flex">
|
| 16 |
+
<div
|
| 17 |
+
style="display:DISPLAY_1; margin-left: auto; margin-right: auto; width: 92px; height:92px; border-radius: 50%; background-size: cover; background-image: url('https://images.genius.com/5a60c41c5543b9286bc6d645603c8df8.568x568x1.jpg')">
|
| 18 |
+
</div>
|
| 19 |
+
</div>
|
| 20 |
+
<div style="text-align: center; margin-top: 3px; font-size: 16px; font-weight: 800">🤖 HuggingArtists Model 🤖</div>
|
| 21 |
+
<div style="text-align: center; font-size: 16px; font-weight: 800">Cardi B</div>
|
| 22 |
+
<a href="https://genius.com/artists/cardi-b">
|
| 23 |
+
<div style="text-align: center; font-size: 14px;">@cardi-b</div>
|
| 24 |
+
</a>
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
I was made with [huggingartists](https://github.com/AlekseyKorshuk/huggingartists).
|
| 28 |
+
|
| 29 |
+
Create your own bot based on your favorite artist with [the demo](https://colab.research.google.com/github/AlekseyKorshuk/huggingartists/blob/master/huggingartists-demo.ipynb)!
|
| 30 |
+
|
| 31 |
+
## How does it work?
|
| 32 |
+
|
| 33 |
+
To understand how the model was developed, check the [W&B report](https://wandb.ai/huggingartists/huggingartists/reportlist).
|
| 34 |
+
|
| 35 |
+
## Training data
|
| 36 |
+
|
| 37 |
+
The model was trained on lyrics from Cardi B.
|
| 38 |
+
|
| 39 |
+
Dataset is available [here](https://huggingface.co/datasets/huggingartists/cardi-b).
|
| 40 |
+
And can be used with:
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from datasets import load_dataset
|
| 44 |
+
|
| 45 |
+
dataset = load_dataset("huggingartists/cardi-b")
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
[Explore the data](https://wandb.ai/huggingartists/huggingartists/runs/gyop804e/artifacts), which is tracked with [W&B artifacts](https://docs.wandb.com/artifacts) at every step of the pipeline.
|
| 49 |
+
|
| 50 |
+
## Training procedure
|
| 51 |
+
|
| 52 |
+
The model is based on a pre-trained [GPT-2](https://huggingface.co/gpt2) which is fine-tuned on Cardi B's lyrics.
|
| 53 |
+
|
| 54 |
+
Hyperparameters and metrics are recorded in the [W&B training run](https://wandb.ai/huggingartists/huggingartists/runs/2ls1zza7) for full transparency and reproducibility.
|
| 55 |
+
|
| 56 |
+
At the end of training, [the final model](https://wandb.ai/huggingartists/huggingartists/runs/2ls1zza7/artifacts) is logged and versioned.
|
| 57 |
+
|
| 58 |
+
## How to use
|
| 59 |
+
|
| 60 |
+
You can use this model directly with a pipeline for text generation:
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from transformers import pipeline
|
| 64 |
+
generator = pipeline('text-generation',
|
| 65 |
+
model='huggingartists/cardi-b')
|
| 66 |
+
generator("I am", num_return_sequences=5)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Or with Transformers library:
|
| 70 |
+
|
| 71 |
+
```python
|
| 72 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead
|
| 73 |
+
|
| 74 |
+
tokenizer = AutoTokenizer.from_pretrained("huggingartists/cardi-b")
|
| 75 |
+
|
| 76 |
+
model = AutoModelWithLMHead.from_pretrained("huggingartists/cardi-b")
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## Limitations and bias
|
| 80 |
+
|
| 81 |
+
The model suffers from [the same limitations and bias as GPT-2](https://huggingface.co/gpt2#limitations-and-bias).
|
| 82 |
+
|
| 83 |
+
In addition, the data present in the user's tweets further affects the text generated by the model.
|
| 84 |
+
|
| 85 |
+
## About
|
| 86 |
+
|
| 87 |
+
*Built by Aleksey Korshuk*
|
| 88 |
+
|
| 89 |
+
[](https://github.com/AlekseyKorshuk)
|
| 90 |
+
|
| 91 |
+
[](https://twitter.com/intent/follow?screen_name=alekseykorshuk)
|
| 92 |
+
|
| 93 |
+
[](https://t.me/joinchat/_CQ04KjcJ-4yZTky)
|
| 94 |
+
|
| 95 |
+
For more details, visit the project repository.
|
| 96 |
+
|
| 97 |
+
[](https://github.com/AlekseyKorshuk/huggingartists)
|
config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "gpt2",
|
| 3 |
+
"activation_function": "gelu_new",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.1,
|
| 8 |
+
"bos_token_id": 50256,
|
| 9 |
+
"embd_pdrop": 0.1,
|
| 10 |
+
"eos_token_id": 50256,
|
| 11 |
+
"gradient_checkpointing": false,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"model_type": "gpt2",
|
| 15 |
+
"n_ctx": 1024,
|
| 16 |
+
"n_embd": 768,
|
| 17 |
+
"n_head": 12,
|
| 18 |
+
"n_inner": null,
|
| 19 |
+
"n_layer": 12,
|
| 20 |
+
"n_positions": 1024,
|
| 21 |
+
"resid_pdrop": 0.1,
|
| 22 |
+
"scale_attn_weights": true,
|
| 23 |
+
"summary_activation": null,
|
| 24 |
+
"summary_first_dropout": 0.1,
|
| 25 |
+
"summary_proj_to_labels": true,
|
| 26 |
+
"summary_type": "cls_index",
|
| 27 |
+
"summary_use_proj": true,
|
| 28 |
+
"task_specific_params": {
|
| 29 |
+
"text-generation": {
|
| 30 |
+
"do_sample": true,
|
| 31 |
+
"max_length": 200,
|
| 32 |
+
"min_length": 100,
|
| 33 |
+
"temperature": 1.0,
|
| 34 |
+
"top_p": 0.95
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"torch_dtype": "float32",
|
| 38 |
+
"transformers_version": "4.10.2",
|
| 39 |
+
"use_cache": true,
|
| 40 |
+
"vocab_size": 50257
|
| 41 |
+
}
|
evaluation.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"eval_loss": 3.3664300441741943, "eval_runtime": 1.6554, "eval_samples_per_second": 42.89, "eval_steps_per_second": 5.437, "epoch": 1.0}
|
flax_model.msgpack
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68dd29573f781095d9ad848fe4c8b6c2a22a1a287ec206a96c4ed108a61559c1
|
| 3 |
+
size 497764120
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
optimizer.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49f94360ec805ce12fe6f0dfa4326451d8c48fda61a78c70af1e43e4ffd058d5
|
| 3 |
+
size 995603825
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74955c53f4c610171358cb48c570ab0c10cc2b3ece76f517c6f6411aaa38644e
|
| 3 |
+
size 510403817
|
rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0def2032f81512e3f8bff61f3e21073854d8d398d1be01592c54d7bfc7c874fd
|
| 3 |
+
size 14503
|
scheduler.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e450cb9c3dd5d5e299310845f6d7ab8731c0d1d1d427cd56769b403ce862ce4
|
| 3 |
+
size 623
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": "<|endoftext|>", "bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "add_prefix_space": false, "model_max_length": 1024, "special_tokens_map_file": null, "name_or_path": "gpt2", "tokenizer_class": "GPT2Tokenizer"}
|
trainer_state.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_metric": 3.3664300441741943,
|
| 3 |
+
"best_model_checkpoint": "output/cardi-b/checkpoint-58",
|
| 4 |
+
"epoch": 1.0,
|
| 5 |
+
"global_step": 58,
|
| 6 |
+
"is_hyper_param_search": false,
|
| 7 |
+
"is_local_process_zero": true,
|
| 8 |
+
"is_world_process_zero": true,
|
| 9 |
+
"log_history": [
|
| 10 |
+
{
|
| 11 |
+
"epoch": 0.09,
|
| 12 |
+
"learning_rate": 0.00013469952948681868,
|
| 13 |
+
"loss": 3.9273,
|
| 14 |
+
"step": 5
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"epoch": 0.17,
|
| 18 |
+
"learning_rate": 0.0001273804022850966,
|
| 19 |
+
"loss": 3.6212,
|
| 20 |
+
"step": 10
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"epoch": 0.26,
|
| 24 |
+
"learning_rate": 0.00011577618287734484,
|
| 25 |
+
"loss": 3.5805,
|
| 26 |
+
"step": 15
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"epoch": 0.34,
|
| 30 |
+
"learning_rate": 0.00010073281903200561,
|
| 31 |
+
"loss": 3.7011,
|
| 32 |
+
"step": 20
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"epoch": 0.43,
|
| 36 |
+
"learning_rate": 8.334697219847626e-05,
|
| 37 |
+
"loss": 3.4198,
|
| 38 |
+
"step": 25
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"epoch": 0.52,
|
| 42 |
+
"learning_rate": 6.488607087104036e-05,
|
| 43 |
+
"loss": 3.712,
|
| 44 |
+
"step": 30
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"epoch": 0.6,
|
| 48 |
+
"learning_rate": 4.6695915032671784e-05,
|
| 49 |
+
"loss": 3.5622,
|
| 50 |
+
"step": 35
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"epoch": 0.69,
|
| 54 |
+
"learning_rate": 3.0102567316140575e-05,
|
| 55 |
+
"loss": 3.2665,
|
| 56 |
+
"step": 40
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"epoch": 0.78,
|
| 60 |
+
"learning_rate": 1.6315683018244145e-05,
|
| 61 |
+
"loss": 3.4291,
|
| 62 |
+
"step": 45
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"epoch": 0.86,
|
| 66 |
+
"learning_rate": 6.340326210572357e-06,
|
| 67 |
+
"loss": 3.3414,
|
| 68 |
+
"step": 50
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"epoch": 0.95,
|
| 72 |
+
"learning_rate": 9.037005536513067e-07,
|
| 73 |
+
"loss": 3.2621,
|
| 74 |
+
"step": 55
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"epoch": 1.0,
|
| 78 |
+
"eval_loss": 3.3664300441741943,
|
| 79 |
+
"eval_runtime": 1.5982,
|
| 80 |
+
"eval_samples_per_second": 44.424,
|
| 81 |
+
"eval_steps_per_second": 5.631,
|
| 82 |
+
"step": 58
|
| 83 |
+
}
|
| 84 |
+
],
|
| 85 |
+
"max_steps": 58,
|
| 86 |
+
"num_train_epochs": 1,
|
| 87 |
+
"total_flos": 59705229312000.0,
|
| 88 |
+
"trial_name": null,
|
| 89 |
+
"trial_params": null
|
| 90 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a62540a61b468205c2469fc48112f0523a3e5bd744b567b166b214b48f501b94
|
| 3 |
+
size 2671
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|