mimbres commited on
Commit
d3790d0
1 Parent(s): 24273ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -51,8 +51,8 @@ elif model_name == "YPTF.MoE+Multi (PS)":
51
  else:
52
  raise ValueError(model_name)
53
 
54
- model = load_model_checkpoint(args=args)
55
-
56
  # @title GradIO helper
57
 
58
 
@@ -101,6 +101,7 @@ def prepare_media(source_path_or_url: os.PathLike,
101
  "encoding": str.lower(info.encoding),
102
  }
103
 
 
104
  def process_audio(audio_filepath):
105
  if audio_filepath is None:
106
  return None
@@ -109,6 +110,7 @@ def process_audio(audio_filepath):
109
  midifile = to_data_url(midifile)
110
  return create_html_from_midi(midifile) # html midiplayer
111
 
 
112
  def process_video(youtube_url):
113
  if 'youtu' not in youtube_url:
114
  return None
 
51
  else:
52
  raise ValueError(model_name)
53
 
54
+ model = load_model_checkpoint(args=args, device="cpu")
55
+ model.to("cuda")
56
  # @title GradIO helper
57
 
58
 
 
101
  "encoding": str.lower(info.encoding),
102
  }
103
 
104
+ @spaces.GPU
105
  def process_audio(audio_filepath):
106
  if audio_filepath is None:
107
  return None
 
110
  midifile = to_data_url(midifile)
111
  return create_html_from_midi(midifile) # html midiplayer
112
 
113
+ @spaces.GPU
114
  def process_video(youtube_url):
115
  if 'youtu' not in youtube_url:
116
  return None