Text Generation
Transformers
Safetensors
English
ouro
custom-code
storytelling
small-language-model
recurrent-depth
synthetic-data
custom_code
Instructions to use raincandy-u/MacroStories with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use raincandy-u/MacroStories with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="raincandy-u/MacroStories", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("raincandy-u/MacroStories", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use raincandy-u/MacroStories with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "raincandy-u/MacroStories" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/MacroStories", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/raincandy-u/MacroStories
- SGLang
How to use raincandy-u/MacroStories 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 "raincandy-u/MacroStories" \ --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": "raincandy-u/MacroStories", "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 "raincandy-u/MacroStories" \ --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": "raincandy-u/MacroStories", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use raincandy-u/MacroStories with Docker Model Runner:
docker model run hf.co/raincandy-u/MacroStories
Update README.md
Browse files
README.md
CHANGED
|
@@ -71,36 +71,38 @@ raw_story, story, names = decode_story(
|
|
| 71 |
print(story)
|
| 72 |
```
|
| 73 |
|
| 74 |
-
The
|
|
|
|
|
|
|
| 75 |
|
| 76 |
## Architecture
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
-
|
|
| 81 |
|---|---|
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
|
|
| 86 |
-
| Attention | 2 query heads
|
| 87 |
-
|
|
| 88 |
-
| Normalization | RMSNorm before and after attention
|
| 89 |
-
| Value residual
|
| 90 |
-
| Input/
|
| 91 |
-
| Maximum sequence length | 2,048 tokens |
|
| 92 |
-
| Weight dtype / file size | FP32 / 81,364 bytes |
|
| 93 |
|
| 94 |
| Parameter group | Parameters |
|
| 95 |
|---|---:|
|
| 96 |
-
| Shared
|
| 97 |
-
| Attention | 3,072 |
|
| 98 |
-
|
|
| 99 |
| RMSNorm | 160 |
|
| 100 |
-
|
|
| 101 |
| **Total** | **19,969** |
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
## Training data and procedure
|
| 106 |
|
|
|
|
| 71 |
print(story)
|
| 72 |
```
|
| 73 |
|
| 74 |
+
The decoder consistently replaces numbered character tokens with `Alex`, `Robin`. `raw_story` preserves the character-token text.
|
| 75 |
+
|
| 76 |
+
These markers are registered as special tokens, so `skip_special_tokens=True` would remove character references;
|
| 77 |
|
| 78 |
## Architecture
|
| 79 |
|
| 80 |
+
MacroStories is a decoder-only autoregressive Transformer with **19,969 parameters**. It applies one decoder block four times, sharing the block’s weights across all four passes. The input embedding and output projection also share weights.
|
| 81 |
|
| 82 |
+
| Component | Configuration |
|
| 83 |
|---|---|
|
| 84 |
+
| Vocabulary | 378 WordLevel tokens |
|
| 85 |
+
| Hidden dimension | 32 |
|
| 86 |
+
| SwiGLU intermediate dimension | 48 |
|
| 87 |
+
| Decoder blocks | 1, applied 4 times |
|
| 88 |
+
| Attention | 2 query heads and 1 shared key/value head; head dimension 16 |
|
| 89 |
+
| Position encoding | RoPE |
|
| 90 |
+
| Normalization | RMSNorm before and after each attention and feed-forward sublayer, plus a final output RMSNorm |
|
| 91 |
+
| Value residual | In passes 2–4, average the current value projection with the first pass’s value projection |
|
| 92 |
+
| Input/Output embedding | Shared weight matrix |
|
|
|
|
|
|
|
| 93 |
|
| 94 |
| Parameter group | Parameters |
|
| 95 |
|---|---:|
|
| 96 |
+
| Shared embedding / output projection | 12,096 |
|
| 97 |
+
| Attention projections | 3,072 |
|
| 98 |
+
| SwiGLU projections | 4,608 |
|
| 99 |
| RMSNorm | 160 |
|
| 100 |
+
| Inactive early-exit gate retained in the checkpoint | 33 |
|
| 101 |
| **Total** | **19,969** |
|
| 102 |
|
| 103 |
+
The implementation is adapted from [ByteDance/Ouro](https://huggingface.co/ByteDance/Ouro-1.4B/tree/574fa66cb8bf5abdc979642d01cf2b79b16bfab1).
|
| 104 |
+
|
| 105 |
+
MacroStories was trained from random initialization; no pretrained Ouro weights were used.
|
| 106 |
|
| 107 |
## Training data and procedure
|
| 108 |
|