CodeAntidote commited on
Commit
08d1ce9
·
verified ·
1 Parent(s): e76d2b4

Initial Kids Rhyme Studio setup

Browse files
Files changed (1) hide show
  1. README.md +107 -7
README.md CHANGED
@@ -1,15 +1,115 @@
1
  ---
2
  title: Kids Rhyme Studio
3
- emoji: 😻
4
- colorFrom: yellow
5
- colorTo: red
6
  sdk: gradio
7
  sdk_version: 6.28.0
8
- python_version: '3.12'
9
  app_file: app.py
10
  pinned: false
11
- license: mit
12
- short_description: Personalized kids’ songs in English, Spanish, Telugu & Germa
 
 
13
  ---
14
 
15
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Kids Rhyme Studio
3
+ emoji: 🎵
4
+ colorFrom: pink
5
+ colorTo: yellow
6
  sdk: gradio
7
  sdk_version: 6.28.0
8
+ python_version: 3.12.12
9
  app_file: app.py
10
  pinned: false
11
+ license: other
12
+ short_description: Make a child's word rhyme and hear it sung as a song
13
+ preload_from_hub:
14
+ - ACE-Step/acestep-v15-xl-turbo-diffusers
15
  ---
16
 
17
+ # Kids Rhyme Studio 🎵
18
+
19
+ Turn a child's words into an **original sung song**. Enter a first name, **one
20
+ to ten words**, and a song theme. Pick **English, Spanish,
21
+ Telugu, or German**, then click **Make my rhyme**. Edit the lines if you like,
22
+ then click **Sing my rhyme** to hear and download a WAV file.
23
+
24
+ The song is generated with [ACE-Step 1.5](https://huggingface.co/ACE-Step/acestep-v15-xl-turbo-diffusers).
25
+ It creates a vocal performance with accompaniment from the supplied lyrics;
26
+ this is not spoken narration over music. Generated singing can sometimes
27
+ mispronounce or change a word, especially in less common languages. Listen
28
+ and regenerate if needed. No speech or instrumental-only fallback is used.
29
+ All entered words appear in the written rhyme; longer lists produce a longer song.
30
+
31
+ ## Pick a song theme
32
+
33
+ Choose **Good Habits**, **Kindness & Sharing**, **Bedtime**, **Counting**,
34
+ **Colors & Shapes**, **Animals & Nature**, or **Confidence & Trying Again**.
35
+ Each preset has a lesson and teaching lines in all four languages.
36
+
37
+ Use the optional **Theme prompt** to be more specific, such as “Teach washing
38
+ hands before meals and putting toys away.” Choose **Custom theme** to supply
39
+ your own topic, such as “Feeling brave on the first day of school.”
40
+ Custom themes require a prompt. For the built-in writer, write supplied words
41
+ and prompts in your selected language; it preserves your text without translating it.
42
+ The optional AI writer is instructed to interpret your topic in the chosen language.
43
+
44
+ The selected language is passed explicitly to ACE-Step as `en`, `es`, `te`,
45
+ or `de`, alongside the lyrics and an instruction to sing in that language.
46
+ This configures generation; it does not verify the language of the finished audio.
47
+ If you change your language, theme, words, name, or mood after generating the
48
+ rhyme, click **Make my rhyme** again before singing.
49
+
50
+ The built-in rhyme writer needs no token. The optional AI writer gives more
51
+ varied lyrics when a parent supplies `HF_TOKEN`; it sends the name, words, theme,
52
+ and prompt to a hosted model. The singing model runs on your Space's GPU without an
53
+ Inference Providers token.
54
+
55
+ ## Set up a Hugging Face Space
56
+
57
+ 1. Create a [new Space](https://huggingface.co/new-space), name it
58
+ `kids-rhyme-studio`, and choose **Gradio** as the SDK.
59
+ 2. In **Settings → Hardware**, select **ZeroGPU**. CPU Basic cannot generate
60
+ the song. ZeroGPU provides shared GPU time subject to its usage quota.
61
+ 3. Upload these six files to the **root** of the Space: `README.md`,
62
+ `app.py`, `rhyme_engine.py`, `themes.py`, `audio_engine.py`, and `requirements.txt`.
63
+ The build preloads the singing model (roughly 11 GB), so the first build
64
+ may take some time.
65
+ 4. In the **App** tab, try the example words, click **Make my rhyme**, and
66
+ then **Sing my rhyme**. Wait for the GPU queue and the song to finish.
67
+ 5. Optional: Under **Settings → Variables and secrets**, add `HF_TOKEN` as
68
+ a **secret** if you want the optional AI lyric writer. Otherwise the
69
+ built-in writer works as is; never paste a token into source files.
70
+
71
+ For an existing Space, upload all six files and switch its hardware to
72
+ ZeroGPU before testing the song. The app shows an error when sung generation
73
+ is unavailable; it does not substitute spoken audio.
74
+
75
+ ## Run locally
76
+
77
+ Use Python 3.12 and a CUDA GPU. Install a compatible CUDA-enabled PyTorch
78
+ (version 2.8 or newer) for your system, then run:
79
+
80
+ ```bash
81
+ python -m venv .venv
82
+ source .venv/bin/activate
83
+ pip install gradio==6.28.0 -r requirements.txt
84
+ python app.py
85
+ ```
86
+
87
+ Open the address printed by Gradio. The large song model downloads at first
88
+ startup. A local machine without a GPU can still write rhymes, but cannot
89
+ sing them.
90
+
91
+ ## Notes for parents
92
+
93
+ - Read and listen to the result before sharing it with a child. The simple
94
+ word guard is not a complete child-safety filter, and generated audio can
95
+ differ from the displayed words.
96
+ - Use a nickname. The app has no account or rhyme database. The optional AI
97
+ writer is off by default and sends entered text to its hosted provider only
98
+ when enabled with a configured token.
99
+ - The model's four language codes are `en`, `es`, `te`, and `de`. Singing
100
+ quality and pronunciation vary by language and input.
101
+ - ZeroGPU has daily usage limits and a queue. The Space requires Python
102
+ 3.12.12 (or another version currently supported by ZeroGPU), a compatible
103
+ PyTorch runtime, and sufficient model download time and disk space.
104
+ - To change the optional AI writer, set `LYRICS_MODEL` to another supported
105
+ chat model; its default is `Qwen/Qwen3-4B-Instruct-2507`.
106
+
107
+ ## Files
108
+
109
+ | File | Purpose |
110
+ | --- | --- |
111
+ | `app.py` | Simple word form, editable rhyme, and song player |
112
+ | `rhyme_engine.py` | Input checks, four-language templates, optional AI lyrics |
113
+ | `themes.py` | Suggested lessons and teaching lines in four languages |
114
+ | `audio_engine.py` | ACE-Step sung song generation on ZeroGPU |
115
+ | `requirements.txt` | Song-model Python dependencies |