File size: 790 Bytes
837b808
 
 
 
 
 
 
 
 
 
 
 
 
72684cd
837b808
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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()