Spaces:
Build error
Build error
Update model_helper.py
Browse files- model_helper.py +5 -3
model_helper.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
# @title Model helper
|
|
|
|
|
2 |
import os
|
3 |
from collections import Counter
|
4 |
import argparse
|
@@ -17,9 +19,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 |
-
# import spaces # for zero-GPU
|
21 |
|
22 |
-
|
|
|
23 |
def load_model_checkpoint(args=None):
|
24 |
parser = argparse.ArgumentParser(description="YourMT3")
|
25 |
# General
|
@@ -120,7 +122,7 @@ def load_model_checkpoint(args=None):
|
|
120 |
model.load_state_dict(new_state_dict, strict=False)
|
121 |
return model.eval()
|
122 |
|
123 |
-
|
124 |
def transcribe(model, audio_info):
|
125 |
t = Timer()
|
126 |
|
|
|
1 |
# @title Model helper
|
2 |
+
import spaces # for zero-GPU
|
3 |
+
|
4 |
import os
|
5 |
from collections import Counter
|
6 |
import argparse
|
|
|
19 |
from utils.utils import write_model_output_as_midi, write_err_cnt_as_json
|
20 |
from model.ymt3 import YourMT3
|
21 |
|
|
|
22 |
|
23 |
+
|
24 |
+
@spaces.GPU
|
25 |
def load_model_checkpoint(args=None):
|
26 |
parser = argparse.ArgumentParser(description="YourMT3")
|
27 |
# General
|
|
|
122 |
model.load_state_dict(new_state_dict, strict=False)
|
123 |
return model.eval()
|
124 |
|
125 |
+
@spaces.GPU
|
126 |
def transcribe(model, audio_info):
|
127 |
t = Timer()
|
128 |
|