New model from https://wandb.ai/wandb/huggingtweets/runs/dipw1nv3
Browse files- README.md +85 -0
- config.json +43 -0
- generation_config.json +6 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +5 -0
- tokenizer.json +0 -0
- tokenizer_config.json +9 -0
- training_args.bin +3 -0
- vocab.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
thumbnail: https://github.com/borisdayma/huggingtweets/blob/master/img/logo.png?raw=true
|
| 4 |
+
tags:
|
| 5 |
+
- huggingtweets
|
| 6 |
+
widget:
|
| 7 |
+
- text: "My dream is"
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
<div class="inline-flex flex-col" style="line-height: 1.5;">
|
| 11 |
+
<div class="flex">
|
| 12 |
+
<div
|
| 13 |
+
style="display:inherit; margin-left: 4px; margin-right: 4px; width: 92px; height:92px; border-radius: 50%; background-size: cover; background-image: url('https://pbs.twimg.com/profile_images/556495456805453826/wKEOCDN0_400x400.png')">
|
| 14 |
+
</div>
|
| 15 |
+
<div
|
| 16 |
+
style="display:none; margin-left: 4px; margin-right: 4px; width: 92px; height:92px; border-radius: 50%; background-size: cover; background-image: url('')">
|
| 17 |
+
</div>
|
| 18 |
+
<div
|
| 19 |
+
style="display:none; margin-left: 4px; margin-right: 4px; width: 92px; height:92px; border-radius: 50%; background-size: cover; background-image: url('')">
|
| 20 |
+
</div>
|
| 21 |
+
</div>
|
| 22 |
+
<div style="text-align: center; margin-top: 3px; font-size: 16px; font-weight: 800">🤖 AI BOT 🤖</div>
|
| 23 |
+
<div style="text-align: center; font-size: 16px; font-weight: 800">Andrzej Duda</div>
|
| 24 |
+
<div style="text-align: center; font-size: 14px;">@andrzejduda</div>
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
I was made with [huggingtweets](https://github.com/borisdayma/huggingtweets).
|
| 28 |
+
|
| 29 |
+
Create your own bot based on your favorite user with [the demo](https://colab.research.google.com/github/borisdayma/huggingtweets/blob/master/huggingtweets-demo.ipynb)!
|
| 30 |
+
|
| 31 |
+
## How does it work?
|
| 32 |
+
|
| 33 |
+
The model uses the following pipeline.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
To understand how the model was developed, check the [W&B report](https://wandb.ai/wandb/huggingtweets/reports/HuggingTweets-Train-a-Model-to-Generate-Tweets--VmlldzoxMTY5MjI).
|
| 38 |
+
|
| 39 |
+
## Training data
|
| 40 |
+
|
| 41 |
+
The model was trained on tweets from Andrzej Duda.
|
| 42 |
+
|
| 43 |
+
| Data | Andrzej Duda |
|
| 44 |
+
| --- | --- |
|
| 45 |
+
| Tweets downloaded | 3133 |
|
| 46 |
+
| Retweets | 863 |
|
| 47 |
+
| Short tweets | 299 |
|
| 48 |
+
| Tweets kept | 1971 |
|
| 49 |
+
|
| 50 |
+
[Explore the data](https://wandb.ai/wandb/huggingtweets/runs/5vh7oxw9/artifacts), which is tracked with [W&B artifacts](https://docs.wandb.com/artifacts) at every step of the pipeline.
|
| 51 |
+
|
| 52 |
+
## Training procedure
|
| 53 |
+
|
| 54 |
+
The model is based on a pre-trained [GPT-2](https://huggingface.co/gpt2) which is fine-tuned on @andrzejduda's tweets.
|
| 55 |
+
|
| 56 |
+
Hyperparameters and metrics are recorded in the [W&B training run](https://wandb.ai/wandb/huggingtweets/runs/dipw1nv3) for full transparency and reproducibility.
|
| 57 |
+
|
| 58 |
+
At the end of training, [the final model](https://wandb.ai/wandb/huggingtweets/runs/dipw1nv3/artifacts) is logged and versioned.
|
| 59 |
+
|
| 60 |
+
## How to use
|
| 61 |
+
|
| 62 |
+
You can use this model directly with a pipeline for text generation:
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from transformers import pipeline
|
| 66 |
+
generator = pipeline('text-generation',
|
| 67 |
+
model='huggingtweets/andrzejduda')
|
| 68 |
+
generator("My dream is", num_return_sequences=5)
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Limitations and bias
|
| 72 |
+
|
| 73 |
+
The model suffers from [the same limitations and bias as GPT-2](https://huggingface.co/gpt2#limitations-and-bias).
|
| 74 |
+
|
| 75 |
+
In addition, the data present in the user's tweets further affects the text generated by the model.
|
| 76 |
+
|
| 77 |
+
## About
|
| 78 |
+
|
| 79 |
+
*Built by Boris Dayma*
|
| 80 |
+
|
| 81 |
+
[](https://twitter.com/intent/follow?screen_name=borisdayma)
|
| 82 |
+
|
| 83 |
+
For more details, visit the project repository.
|
| 84 |
+
|
| 85 |
+
[](https://github.com/borisdayma/huggingtweets)
|
config.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
"initializer_range": 0.02,
|
| 12 |
+
"layer_norm_epsilon": 1e-05,
|
| 13 |
+
"model_type": "gpt2",
|
| 14 |
+
"n_ctx": 1024,
|
| 15 |
+
"n_embd": 768,
|
| 16 |
+
"n_head": 12,
|
| 17 |
+
"n_inner": null,
|
| 18 |
+
"n_layer": 12,
|
| 19 |
+
"n_positions": 1024,
|
| 20 |
+
"reorder_and_upcast_attn": false,
|
| 21 |
+
"resid_pdrop": 0.1,
|
| 22 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 23 |
+
"scale_attn_weights": true,
|
| 24 |
+
"summary_activation": null,
|
| 25 |
+
"summary_first_dropout": 0.1,
|
| 26 |
+
"summary_proj_to_labels": true,
|
| 27 |
+
"summary_type": "cls_index",
|
| 28 |
+
"summary_use_proj": true,
|
| 29 |
+
"task_specific_params": {
|
| 30 |
+
"text-generation": {
|
| 31 |
+
"do_sample": true,
|
| 32 |
+
"max_length": 160,
|
| 33 |
+
"min_length": 10,
|
| 34 |
+
"prefix": "<|endoftext|>",
|
| 35 |
+
"temperature": 1.0,
|
| 36 |
+
"top_p": 0.95
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"torch_dtype": "float32",
|
| 40 |
+
"transformers_version": "4.29.2",
|
| 41 |
+
"use_cache": true,
|
| 42 |
+
"vocab_size": 50257
|
| 43 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 50256,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"transformers_version": "4.29.2"
|
| 6 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4b71bd6efde1c153f6115ee980a67dc54f2053ccf7994b6824e627fbe66cb3f
|
| 3 |
+
size 510398013
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"unk_token": "<|endoftext|>"
|
| 5 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"bos_token": "<|endoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": true,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"model_max_length": 1024,
|
| 7 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 8 |
+
"unk_token": "<|endoftext|>"
|
| 9 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a85816d152cc47c1195f1bad7ec79433fccf96389eb72268269abb1df4c4d24
|
| 3 |
+
size 3899
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|