Update model_helper.py
Browse files- model_helper.py +3 -1
model_helper.py
CHANGED
@@ -17,7 +17,9 @@ from utils.event2note import merge_zipped_note_events_and_ties_to_notes
|
|
17 |
from utils.utils import write_model_output_as_midi, write_err_cnt_as_json
|
18 |
from model.ymt3 import YourMT3
|
19 |
|
|
|
20 |
|
|
|
21 |
def load_model_checkpoint(args=None):
|
22 |
parser = argparse.ArgumentParser(description="YourMT3")
|
23 |
# General
|
@@ -118,7 +120,7 @@ def load_model_checkpoint(args=None):
|
|
118 |
model.load_state_dict(new_state_dict, strict=False)
|
119 |
return model.eval()
|
120 |
|
121 |
-
|
122 |
def transcribe(model, audio_info):
|
123 |
t = Timer()
|
124 |
|
|
|
17 |
from utils.utils import write_model_output_as_midi, write_err_cnt_as_json
|
18 |
from model.ymt3 import YourMT3
|
19 |
|
20 |
+
import spaces # for zero-GPU
|
21 |
|
22 |
+
@spaces.GPU
|
23 |
def load_model_checkpoint(args=None):
|
24 |
parser = argparse.ArgumentParser(description="YourMT3")
|
25 |
# General
|
|
|
120 |
model.load_state_dict(new_state_dict, strict=False)
|
121 |
return model.eval()
|
122 |
|
123 |
+
@spaces.GPU
|
124 |
def transcribe(model, audio_info):
|
125 |
t = Timer()
|
126 |
|