Instructions to use bugrayildirim/story-to-music-analyzer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bugrayildirim/story-to-music-analyzer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bugrayildirim/story-to-music-analyzer")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("bugrayildirim/story-to-music-analyzer") model = AutoModelForSeq2SeqLM.from_pretrained("bugrayildirim/story-to-music-analyzer") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bugrayildirim/story-to-music-analyzer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bugrayildirim/story-to-music-analyzer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bugrayildirim/story-to-music-analyzer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bugrayildirim/story-to-music-analyzer
- SGLang
How to use bugrayildirim/story-to-music-analyzer 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 "bugrayildirim/story-to-music-analyzer" \ --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": "bugrayildirim/story-to-music-analyzer", "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 "bugrayildirim/story-to-music-analyzer" \ --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": "bugrayildirim/story-to-music-analyzer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bugrayildirim/story-to-music-analyzer with Docker Model Runner:
docker model run hf.co/bugrayildirim/story-to-music-analyzer
Story-to-Music Analyzer (Türkçe Metin → Müzik Metadata)
google/mt5-small'un Türkçe metinleri Suno ve Udio için müzik parametrelerine
çeviren fine-tuned versiyonu. Story-to-Music MCP
projesinin "Analyzer" bileşeni.
Görev
Türkçe bir metin (hikâye, şarkı sözü, konsept) verildiğinde, model şu JSON yapısını üretir:
{
"emotion": "özlem",
"energy": 4,
"bpm": 80,
"key": "A minor",
"instruments": ["ney", "saz"],
"vocal_style": "erkek, kısık, dramatik",
"suno_style_prompt": "melancholic Turkish ballad with ney flute and saz, slow tempo"
}
Kullanım
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("bugrayildirim/story-to-music-analyzer")
model = AutoModelForSeq2SeqLM.from_pretrained("bugrayildirim/story-to-music-analyzer")
text = "Bir zamanlar büyük bir aşk yaşamıştım. Sonra o aşk gitti."
prompt = f"Şu metni analiz et ve müzik promptu üret: {text}"
inputs = tokenizer(prompt, return_tensors="pt", max_length=512, truncation=True)
outputs = model.generate(**inputs, max_new_tokens=192, num_beams=4, early_stopping=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Eğitim
- Base model:
google/mt5-small(556M parametre) - Veri: 854 Türkçe şarkı sözü + Ollama (qwen2.5:7b) tarafından üretilen
metadata etiketleri (
distill_data.pypipeline'ı, GitHub) - Eğitim: Kaggle T4 GPU, 17 epoch, eval_loss 0.54'e kadar düştü
- Önemli:
fp16=False(mT5'in fp16'da NaN sorunu var), gradient checkpointing aktif
Detaylar: training/story_to_music_train.ipynb
Performans
JSON validity ve alan kapsamı (eval set 86 örnek):
- Geçerli JSON: 100%
- Tüm alanların kapsamı: 100%
Limitations
- Sadece Türkçe metin destekler
- CPU'da inference ~5 saniye (T4 GPU'da ~500ms)
suno_style_promptalanı bazen yarı-Türkçe yarı-İngilizce çıktı verebilir (Story-to-Music MCP server bunu deterministik fallback ile düzeltir)
Lisans
MIT. Eğitim verisi olarak kullanılan şarkı sözlerinin telif hakları orijinal sahiplerine aittir; bu model stil/duygu örüntülerini öğrenmek için eğitildi, şarkı sözü ezberi yapmaz.
Atıf
@misc{story-to-music-analyzer,
author = {Buğra Yıldırım},
title = {Story-to-Music Analyzer: Turkish text to music metadata},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/bugrayildirim/story-to-music-analyzer}},
}
- Downloads last month
- 47
Model tree for bugrayildirim/story-to-music-analyzer
Base model
google/mt5-small