juancopi81 commited on
Commit
c0fa1b2
1 Parent(s): e7deb87

rollback to audio_path

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -53,10 +53,10 @@ def get_audio(url):
53
  def populate_metadata(link):
54
  yt = YouTube(link)
55
  audio = get_audio(link)
56
- return yt.thumbnail_url, yt.title, audio
57
 
58
  def inference(yt_audio_path):
59
-
60
  with open(yt_audio_path, 'rb') as fd:
61
  contents = fd.read()
62
 
@@ -107,8 +107,9 @@ with demo:
107
  img = gr.Image(label="Thumbnail")
108
  with gr.Row():
109
  yt_audio = gr.Audio()
 
110
 
111
- link.change(fn=populate_metadata, inputs=link, outputs=[img, title, yt_audio])
112
 
113
  with gr.Row():
114
  btn = gr.Button("Transcribe music")
@@ -118,7 +119,7 @@ with demo:
118
  midi_audio = gr.Audio()
119
 
120
  btn.click(inference,
121
- inputs=["final_audio.wav"],
122
  outputs=[midi_file, midi_audio])
123
 
124
  gr.Markdown(article)
 
53
  def populate_metadata(link):
54
  yt = YouTube(link)
55
  audio = get_audio(link)
56
+ return yt.thumbnail_url, yt.title, audio, audio
57
 
58
  def inference(yt_audio_path):
59
+
60
  with open(yt_audio_path, 'rb') as fd:
61
  contents = fd.read()
62
 
 
107
  img = gr.Image(label="Thumbnail")
108
  with gr.Row():
109
  yt_audio = gr.Audio()
110
+ yt_audio_path = gr.Textbox()
111
 
112
+ link.change(fn=populate_metadata, inputs=link, outputs=[img, title, yt_audio, yt_audio_path])
113
 
114
  with gr.Row():
115
  btn = gr.Button("Transcribe music")
 
119
  midi_audio = gr.Audio()
120
 
121
  btn.click(inference,
122
+ inputs=yt_audio_path,
123
  outputs=[midi_file, midi_audio])
124
 
125
  gr.Markdown(article)