CoolFace
Apppublic

Systema77/sheetsage2-demo

sourceHugging Facecc-by-nc-4.0updated 1d agoView on Hugging Face
0likes
App README

SheetSage2 demo

Upload (or record) a music clip and get back a transcription from `m-a-p/SheetSage2`: ABC notation, timed .lab annotations, MIDI, and — when the model writes them — rendered sheet-music/preview files.

⚠️ Before you deploy this, please read

This Space was assembled without being able to reach huggingface.co from the sandbox that built it (the network egress policy there blocks the huggingface.co domain entirely — confirmed, not assumed). So:

  • The app code below is written from m-a-p/SheetSage2's publicly reported API (found via web search, not by reading the model card directly): AutoModel.from_pretrained("m-a-p/SheetSage2", trust_remote_code=True) and a .transcribe(audio, output_dir=...) method returning ABC / MIDI / events / per-part MIDIs / .lab text, plus rendered files on disk when output_dir is given. It has not been run end-to-end against the real model. Please smoke-test it once on your own Space before relying on it.
  • `m-a-p/SheetSage2` is gated and built on `MERT-v2-FullSong`, which is also gated. You (the account behind this Space) need to have been granted access to both repos on the Hub, and the Space needs an HF_TOKEN secret with that access — set it under Space → Settings → Variables and secrets.
  • The model needs a real GPU in practice (it's a full transcription pipeline, not a toy). This app defaults to CPU and will be slow-to-broken there; it includes an optional ZeroGPU hook (the spaces package) — enable it if you deploy on a ZeroGPU Space, or otherwise pick a GPU hardware tier.
  • The model reportedly needs FFmpeg 6.1 specifically. packages.txt below asks apt for ffmpeg, but the base Space image's apt repo may ship an older/newer build. If transcription fails with an ffmpeg-related error, that's the first thing to check.
  • SheetSage2 almost certainly has its own requirements.txt in its repo (referenced by third-party writeups) that pins extra dependencies (likely something in the music21/pretty_midi/librosa/soundfile family for rendering). I could not fetch that file, so requirements.txt here only has the dependencies that were actually documented (torch==2.8.0, torchaudio==2.8.0, huggingface-hub==0.36.0) plus the obvious Gradio/transformers stack. Open the real `requirements.txt` at <https://huggingface.co/m-a-p/SheetSage2/tree/main> and merge anything missing in before you deploy.

None of this is a reason not to ship it — it's the honest list of what to verify once you (or a session with Hub access) can actually reach the model.

Deploying

This directory was built locally and was not pushed to the Hub (same network restriction as above). To deploy:

bash
# from this directory
huggingface-cli login   # or set HF_TOKEN
huggingface-cli repo create sheetsage2-demo --type space --space_sdk gradio
git init
git remote add space https://huggingface.co/spaces/<your-username>/sheetsage2-demo
git add .
git commit -m "Initial SheetSage2 demo"
git push space main

or just drag-and-drop these files into a new Space via the web UI.

Then set the HF_TOKEN secret (Settings → Variables and secrets) to a token from an account with access to m-a-p/SheetSage2 and its MERT-v2-FullSong base model.

Files

  • app.py — the Gradio interface
  • requirements.txt — Python dependencies
  • packages.txt — apt packages (ffmpeg)