|
--- |
|
library_name: transformers |
|
tags: |
|
- text-generation |
|
- turkish |
|
- gpt2 |
|
license: apache-2.0 |
|
language: |
|
- tr |
|
base_model: |
|
- ytu-ce-cosmos/turkish-gpt2-large |
|
pipeline_tag: text-generation |
|
--- |
|
|
|
# Model Card for Model ID |
|
|
|
This model is a fine-tuned version of [ytu-ce-cosmos/turkish-gpt2-large](https://huggingface.co/ytu-ce-cosmos/turkish-gpt2-large), trained on 100,000 Turkish poems. It specializes in generating poetry in Turkish with fluency and coherence. |
|
|
|
## How to Get Started with the Model |
|
|
|
Use the code below to get started with the model. |
|
|
|
```python |
|
|
|
from transformers import pipeline, AutoTokenizer, GPT2LMHeadModel |
|
|
|
model = GPT2LMHeadModel.from_pretrained("yeniguno/gpt2-turkish-poem-generator") |
|
tokenizer = AutoTokenizer.from_pretrained("yeniguno/gpt2-turkish-poem-generator") |
|
|
|
text_generator = pipeline('text-generation', model=model, tokenizer=tokenizer) |
|
|
|
response = text_generator("Dağ başındasın, ", max_length=100) |
|
|
|
print(f"\nRESPONSE\n{response}") |
|
""" |
|
RESPONSE |
|
[{'generated_text': 'Dağ başındasın, uçar peşinde. Bir düştün şu garip dünyaya. Girdin sen de dünyamı başıma. Hiç acımadın bu genç yaşa. Uçtun, tozdun, bir başına. Sen de bir çocuk olmuştun. Ağlıyordun, o dünyada. Gel, gör bir de gör, ne olmuşsun. Yaşamak, düşlemek ne olmuşsun. Gel, gör bu genç yaşta ne olmuşsun.\nUçmayı, dağlarda gezmeyi düşlüyordun, Uçmak, ağaçlarda'}] |
|
""" |
|
``` |
|
|
|
## Training Details |
|
|
|
## Training Details |
|
- **Training Dataset:** 100K Turkish poems from diverse sources. |
|
- **Tokenizer:** Inherited from `turkish-gpt2-large`. |
|
- **Training Steps:** 18,714 |
|
- **Epochs:** 3 |
|
- **Optimizer:** AdamW |
|
|
|
### Loss Metrics |
|
| Epoch | Training Loss | Validation Loss | |
|
|-------|--------------|----------------| |
|
| 1 | 3.9527 | 3.8496 | |
|
| 2 | 3.6406 | 3.7984 | |
|
| 3 | 3.3847 | 3.7995 | |
|
|
|
### Final Training Metrics |
|
- **Global Steps:** 18,714 |
|
- **Final Training Loss:** 3.6842 |
|
- **Train Runtime:** 15,003s (~4.2 hours) |
|
- **Samples per Second:** 19.96 |
|
- **Steps per Second:** 1.25 |
|
- **Total FLOPs:** 6.52 × 10¹⁷ |