Text Generation
Transformers
Safetensors
English
gpt2
lyrics
suno
music
scansion
text-generation-inference
Instructions to use wren11ws/sunup with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wren11ws/sunup with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wren11ws/sunup")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wren11ws/sunup") model = AutoModelForCausalLM.from_pretrained("wren11ws/sunup", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wren11ws/sunup with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wren11ws/sunup" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wren11ws/sunup", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/wren11ws/sunup
- SGLang
How to use wren11ws/sunup 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 "wren11ws/sunup" \ --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": "wren11ws/sunup", "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 "wren11ws/sunup" \ --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": "wren11ws/sunup", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use wren11ws/sunup with Docker Model Runner:
docker model run hf.co/wren11ws/sunup
|
Download README.md from wren11ws/sunup: direct link, hf CLI and curl.
- Browser
- Download file 3.66 kB
-
https://huggingface.co/wren11ws/sunup/resolve/main/README.md
- Command line
-
hf download hf://wren11ws/sunup/README.md
-
curl -L -o README.md https://huggingface.co/wren11ws/sunup/resolve/main/README.md
3.66 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: distilgpt2 | |
| tags: | |
| - gpt2 | |
| - lyrics | |
| - suno | |
| - music | |
| - scansion | |
| - text-generation | |
| widget: | |
| - text: "Title: Heat Line\nIdea: A man scraping survival out of desert heat, stubborn will over panic.\nVerse:\n" | |
| example_title: Desert verse | |
| - text: "Title: As It Stays\nIdea: Driving the empty freeway after a fight you cannot unsay.\nChorus:\n" | |
| example_title: Night chorus | |
| # π Scansion-LM Foundry | |
| A high-performance causal language modeling harness that learns rhyme density, poetic scansion, and structured lyric progressions for Suno Custom Mode. | |
| Fine-tuned from `distilgpt2` on clean, original lyric extracts. The model produces natural English rhythmic lines conforming to Suno Studio V6 scansion rules. | |
| --- | |
| ## β‘ Quick Start | |
| ### 1. Launch Loopback HTTP Sidecar (Port 8099) | |
| ```powershell | |
| .\run-engine.cmd | |
| ``` | |
| *Hosts the loopback server on `http://127.0.0.1:8099`, automatically connecting to Scansion Studio Web UI.* | |
| ### 2. Command Line Pipeline Operations | |
| ```powershell | |
| # Extract meter, rhyme schemes, and sections | |
| python -m scansion_lm extract 640 | |
| # Tokenize corpus using Hugging Face AutoTokenizer | |
| python -m scansion_lm tokenize | |
| # Fine-tune causal language model | |
| python -m scansion_lm train 300 640 | |
| # Evaluate against gold standard metric sheet | |
| python -m scansion_lm eval | |
| # Verify weights and model card readiness | |
| python -m scansion_lm check | |
| # Export model bundle for Hugging Face Hub | |
| python -m scansion_lm export | |
| ``` | |
| --- | |
| ## π‘ Sidecar HTTP API Endpoints (Port 8099) | |
| | Method | Endpoint | Description | | |
| |---|---|---| | |
| | `GET` | `/health` | Instant readiness and training state probe | | |
| | `GET` | `/status` | Phase, step count, loss, and training process ID | | |
| | `GET` | `/metrics` | Real-time training loss and validation progression | | |
| | `GET` | `/trending` | Returns cached Suno trending metadata and tags | | |
| | `POST` | `/ingest-batch` | Batch ingests new song lyrics into `user_extracts.jsonl` | | |
| | `POST` | `/train` | Spawns background fine-tuning process | | |
| | `POST` | `/infer` | Autoregressive lyric generation from idea/theme | | |
| | `POST` | `/extract` | Scans input lyrics for feet, meter, and rhyme scheme | | |
| --- | |
| ## π§ Model Architecture | |
| | Component | Specification | | |
| |---|---| | |
| | Base Architecture | `distilgpt2` (`GPT2LMHeadModel`) | | |
| | Parameters | 81,912,576 (81.9M) | | |
| | Vocabulary Size | 50,257 tokens (GPT-2 BPE) | | |
| | Context Length | 1,024 tokens (256 training window) | | |
| | Storage Format | `safetensors` (zero pickle vulnerability) | | |
| | Checkpoint Size | ~327 MB | | |
| --- | |
| ## π License | |
| Licensed under the **Apache 2.0 License**. See `LICENSE` for details. | |
| ## Checkpoint | |
| - architecture: `['GPT2LMHeadModel']` | |
| - vocab_size: `50260` | |
| - n_positions: `1024` | |
| - n_layer / n_embd / n_head: `6 / 768 / 12` | |
| - parameters: `81914880` | |
| - steps: `300/300` | |
| - train loss (avg): `4.009729862213135` | |
| - examples: `3500` | |
| Load with vanilla Transformers β no custom `auto_map`: | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| tok = AutoTokenizer.from_pretrained("scansion-lm") | |
| model = AutoModelForCausalLM.from_pretrained("scansion-lm") | |
| prompt = """Title: Heat Line | |
| Idea: A man scraping survival out of desert heat, stubborn will over panic. | |
| Verse: | |
| """ | |
| ids = tok(prompt, return_tensors="pt") | |
| out = model.generate(**ids, max_new_tokens=80, do_sample=True, temperature=0.85, | |
| pad_token_id=tok.pad_token_id, eos_token_id=tok.eos_token_id) | |
| print(tok.decode(out[0], skip_special_tokens=False)) | |
| ``` | |
| Upload: | |
| ```bash | |
| huggingface-cli upload ./export scansion-lm --repo-type model | |
| ``` | |