Instructions to use BananaMind/StoryBananaMind-7.5M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BananaMind/StoryBananaMind-7.5M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BananaMind/StoryBananaMind-7.5M")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("BananaMind/StoryBananaMind-7.5M") model = AutoModelForMultimodalLM.from_pretrained("BananaMind/StoryBananaMind-7.5M") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BananaMind/StoryBananaMind-7.5M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BananaMind/StoryBananaMind-7.5M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BananaMind/StoryBananaMind-7.5M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BananaMind/StoryBananaMind-7.5M
- SGLang
How to use BananaMind/StoryBananaMind-7.5M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "BananaMind/StoryBananaMind-7.5M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BananaMind/StoryBananaMind-7.5M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "BananaMind/StoryBananaMind-7.5M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BananaMind/StoryBananaMind-7.5M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BananaMind/StoryBananaMind-7.5M with Docker Model Runner:
docker model run hf.co/BananaMind/StoryBananaMind-7.5M
StoryBananaMind-7.5M
StoryBananaMind-7.5M is a small GPT-2 style causal language model trained for short English story generation on the TinyStories dataset.
Model Details
- Architecture:
GPT2LMHeadModel - Parameters: 7,428,960
- Vocabulary size: 8,192
- Context length: 256 tokens
- Hidden size: 288
- Layers: 5
- Attention heads: 6
- Weights format:
safetensors - Training dataset:
roneneldan/TinyStories
Intended Use
This model is intended for lightweight English story generation experiments, educational use, and local text-generation testing. It is a very small model and should not be expected to perform broad instruction following, factual answering, or robust reasoning.
Usage
from transformers import AutoTokenizer, GPT2LMHeadModel
import torch
model_id = "StoryBananaMind-7.5M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = GPT2LMHeadModel.from_pretrained(model_id).eval()
prompt = "Once upon a time, there was a little cat named Lily."
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=120,
temperature=0.8,
top_p=0.95,
do_sample=True,
repetition_penalty=1.1,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training
The model was trained from scratch with a custom GPT-2 tokenizer trained to an 8,192-token vocabulary. Training used fixed 256-token blocks from TinyStories.
Key configuration:
n_layer: 5n_embd: 288n_head: 6n_inner: 1152n_positions: 256vocab_size: 8192
Files
model.safetensors: model weightsconfig.json: Transformers model configurationgeneration_config.json: default generation configurationtokenizer.json: tokenizertokenizer_config.json: tokenizer metadatastorybananamind-preview.png: model card preview image
- Downloads last month
- 11
