Spaces:
Sleeping
Sleeping
Download app.py from musicians/deepharmony: direct link, hf CLI and curl.
- Browser
- Download file 790 Bytes
-
https://huggingface.co/spaces/musicians/deepharmony/resolve/main/app.py
- Command line
-
hf download hf://spaces/musicians/deepharmony/app.py
-
curl -L -o app.py https://huggingface.co/spaces/musicians/deepharmony/resolve/main/app.py
790 Bytes
| import gradio as gr | |
| import sys | |
| import os | |
| module_path = os.path.abspath(os.path.join('./lib')) | |
| if module_path not in sys.path: | |
| sys.path.append(module_path) | |
| import Generator | |
| def predict(chordsBefore, numGenerate): | |
| gen = Generator.Generator() | |
| newChords = gen.generateChords(chordsBefore.split(","), numGenerate) | |
| return ",".join(newChords) | |
| title = "Chord Generator" | |
| description = "Chord Generation with Tensorflow" | |
| interpretation='default' | |
| enable_queue=True | |
| gr.Interface( | |
| fn=predict, | |
| inputs=[ | |
| gr.inputs.Textbox(placeholder="D-7,G7,C^7"), | |
| gr.inputs.Number(label="Number of Chords To Generate"), | |
| ], | |
| outputs=gr.Textbox(label="Generated Chords"), | |
| title=title, | |
| description=description, | |
| interpretation=interpretation, | |
| enable_queue=enable_queue | |
| ).launch() | |