gemma3n-e2b-children-storyteller
This model is a fine-tuned version of unsloth/gemma-3n-e2b-it-unsloth-bnb-4bit. It has been specifically trained to generate engaging and appropriate children's stories.
Model Description
gemma3n-e2b-children-storyteller
leverages the powerful gemma-3n-e2b-it-unsloth-bnb-4bit
base model and has undergone further fine-tuning to excel at creative storytelling for a young audience. The goal of this fine-tuning was to imbue the model with the ability to craft imaginative narratives, often incorporating whimsical elements, simple language, and positive themes suitable for children.
Training Data
The specific dataset used for fine-tuning this model was not specified in the original request. To make this model card more comprehensive, the dataset is containning children stories.
- Dataset Name: [A custom dataset of children's books, a subset of Project Gutenberg filtered for children's literature]
- Size: [unique stories, over than 91000 raw text data]
- Pre-processing: [tokenized, formatted as conversational turns for SFT]
Training Procedure
This model was trained with Supervised Fine-Tuning (SFT) using the TRL library.
- Base Model:
unsloth/gemma-3n-e2b-it-unsloth-bnb-4bit
- Framework: PyTorch / Transformers / TRL
- Fine-tuning Method: SFT (Supervised Fine-Tuning)
- Hyperparameters: (Please add your specific hyperparameters here for better reproducibility)
- Learning Rate: [, 2e-5]
- Batch Size: [, 1]
- Epochs: [, 3]
- Optimizer: [, AdamW with bitsandbytes]
- LoRA/QLoRA configuration (if applicable): [e.g.,
r=16, lora_alpha=32, target_modules=["q_proj", "v_proj"]
...]
How to Use
You can easily use this model for text generation, particularly for generating children's stories, using the Hugging Face pipeline
API.
from transformers import pipeline
# Adjust 'device' as necessary ('cuda' for GPU, '-1' for CPU)
# Make sure to replace "None" with "your-username/gemma3n-e2b-children-storyteller"
# once you upload the model.
generator = pipeline("text-generation", model="Fedifehmi/gemma3n-e2b-children-storyteller", device="cuda")
# Example 1: Asking a creative question
question1 = "Tell me a short story about a brave little rabbit who wanted to fly."
output1 = generator([{"role": "user", "content": question1}], max_new_tokens=200, return_full_text=False)[0]
print("Story 1:\n", output1["generated_text"])
# Example 2: Another creative prompt
question2 = "Imagine a magical tree that grows candy. What kind of adventures happen near it?"
output2 = generator([{"role": "user", "content": question2}], max_new_tokens=150, return_full_text=False)[0]
print("\nStory 2:\n", output2["generated_text"])
"""
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}
"""
- Downloads last month
- 28