Hmjz100 commited on
Commit
1252d65
·
1 Parent(s): 231a39d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -260,7 +260,7 @@ inference_model = InferenceModel('/home/user/app/checkpoints/mt3/', 'mt3')
260
 
261
  def inference(url):
262
  os.system(f"yt-dlp -x {url} -o 'audio.%(ext)s'")
263
- audio = glob.glob('audio.*')[0]
264
  with open(audio, 'rb') as fd:
265
  contents = fd.read()
266
  audio = callbak_audio(contents,sample_rate=16000)
@@ -268,10 +268,10 @@ def inference(url):
268
  note_seq.sequence_proto_to_midi_file(est_ns, './transcribed.mid')
269
  return './transcribed.mid'
270
 
271
- title = "YouTube-to-MT3"
272
- description = "将YouTube音频上传到MT3:多任务多轨音乐转录。感谢 <a href=\"https://huggingface.co/spaces/akhaliq/MT3\">akhaliq</a> 的原始 <i>Spaces</i> 实现。"
273
 
274
- article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.03017' target='_blank'>MT3: 多任务多轨音乐转录</a> | <a href='https://github.com/magenta/mt3' target='_blank'>Github 仓库</a></p>"
275
 
276
  gr.Interface(
277
  inference,
 
260
 
261
  def inference(url):
262
  os.system(f"yt-dlp -x {url} -o 'audio.%(ext)s'")
263
+ audio = glob2.glob('audio.*')[0]
264
  with open(audio, 'rb') as fd:
265
  contents = fd.read()
266
  audio = callbak_audio(contents,sample_rate=16000)
 
268
  note_seq.sequence_proto_to_midi_file(est_ns, './transcribed.mid')
269
  return './transcribed.mid'
270
 
271
+ title = "YouTube-To-MT3"
272
+ description = "将YouTube音频上传到 MT3:多任务多音轨音乐转录的 Gradio 演示。感谢 <a href=\"https://huggingface.co/spaces/akhaliq/MT3\">akhaliq</a> 的原始 <i>Spaces</i> 实现。"
273
 
274
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.03017' target='_blank'>MT3: 多任务多音轨音乐转录</a> | <a href='https://github.com/magenta/mt3' target='_blank'>Github 仓库</a></p>"
275
 
276
  gr.Interface(
277
  inference,