juancopi81 commited on
Commit
be33ae4
1 Parent(s): 8eb2669

Change path to models and remove file

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -20,7 +20,7 @@ current_model = "mt3"
20
 
21
  def change_model(model):
22
  global current_model
23
- checkpoint_path = f"/content/checkpoints/{model}/"
24
  if model == current_model:
25
  return
26
  global inference_model
@@ -43,7 +43,6 @@ def get_audio(url):
43
  ten_seconds = 10 * 1000
44
  first_10_seconds = wav_to_cut[:ten_seconds]
45
  os.remove(new_file)
46
- os.remove(a)
47
  return first_10_seconds
48
 
49
  # Credits https://huggingface.co/spaces/jeffistyping/Youtube-Whisperer
@@ -80,12 +79,15 @@ with demo:
80
  + "</h1>")
81
  gr.Markdown(description)
82
  with gr.Box():
83
- gr.Markdown("""
84
- Select your model: The ismir2021 model transcribes piano only, with note velocities.
85
- The mt3 model transcribes multiple simultaneous instruments, but without velocities.
86
- """)
 
87
  model = gr.Radio(
88
- ["mt3", "ismir2021"], label="What kind of model you want to use?", value="mt3"
 
 
89
  )
90
  model.change(fn=change_model, inputs=model, outputs=[])
91
 
@@ -109,6 +111,8 @@ with demo:
109
  ],
110
  outputs=audio_file)
111
 
 
 
112
 
113
  demo.launch()
114
 
 
20
 
21
  def change_model(model):
22
  global current_model
23
+ checkpoint_path = f"/home/user/app/checkpoints/{model}/"
24
  if model == current_model:
25
  return
26
  global inference_model
 
43
  ten_seconds = 10 * 1000
44
  first_10_seconds = wav_to_cut[:ten_seconds]
45
  os.remove(new_file)
 
46
  return first_10_seconds
47
 
48
  # Credits https://huggingface.co/spaces/jeffistyping/Youtube-Whisperer
 
79
  + "</h1>")
80
  gr.Markdown(description)
81
  with gr.Box():
82
+ model_label = """
83
+ What kind of model you want to use?
84
+ The ismir2021 model transcribes piano only, with note velocities.
85
+ The mt3 model transcribes multiple simultaneous instruments, but without velocities.
86
+ """
87
  model = gr.Radio(
88
+ ["mt3", "ismir2021"],
89
+ label=model_label,
90
+ value="mt3"
91
  )
92
  model.change(fn=change_model, inputs=model, outputs=[])
93
 
 
111
  ],
112
  outputs=audio_file)
113
 
114
+ gr.Markdown(article)
115
+
116
 
117
  demo.launch()
118