Downloads · 30 days
86
46% of all-time downloads
vuminhtue/gemma3_270m_tinystories_sentiment
gemma3_270m_tinystories_sentiment is a text generation model from vuminhtue. Use it when you need the model to write or continue text. The card lists the license as mit.
This is a Gemma3-270M model pre-trained on the TinyStories dataset for 150k iterations.
Downloads · 30 days
86
46% of all-time downloads
All-time downloads
185
Public
Repo size
330 MB
Likes
0
Public
Click a slice to open those files.
.pt330 MB · 100%
From the Hugging Face model README
This is a Gemma3-270M model pre-trained on the TinyStories dataset for 150k iterations.
from huggingface_hub import hf_hub_download
import torch
# Download model weights
model_path = hf_hub_download(
repo_id="vuminhtue/gemma3_270m_150k_tinystories",
filename="Gemma3_270m_150k_model_params.pt"
)
# Download config
config_path = hf_hub_download(
repo_id="vuminhtue/gemma3_270m_150k_tinystories",
filename="config.json"
)
import torch
import tiktoken
from Gemma3_model import Gemma3Model # You need this file from the original code
# Set up configuration
GEMMA3_CONFIG = {
"vocab_size": 256000,
"context_length": 8192,
"emb_dim": 2048,
"n_heads": 8,
"n_layers": 18,
"hidden_dim": 16384,
"head_dim": 256,
"dtype": torch.bfloat16,
}
# Load model
model = Gemma3Model(GEMMA3_CONFIG)
device = "cuda" if torch.cuda.is_available() else "cpu"
model.load_state_dict(torch.load(model_path, map_location=device))
model = model.to(device)
model.eval()
# Generate text
tokenizer = tiktoken.get_encoding("gpt2")
# Your generation code here...
The model was trained on TinyStories, a dataset of simple stories for children. It can generate coherent short stories in a similar style.
If you use this model, please cite:
@misc{gemma3-tinystories-2025,
author = {Your Name},
title = {Gemma3-270M Pre-trained on TinyStories},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/vuminhtue/gemma3_270m_150k_tinystories}},
}
MIT License
For questions or issues, please open an issue on the HuggingFace model page.