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()