Spaces:
Sleeping
Sleeping
Commit
·
86f6f17
1
Parent(s):
d9df210
cpu support only
Browse files- utils_app.py +4 -5
utils_app.py
CHANGED
|
@@ -112,7 +112,7 @@ def run_inference(params):
|
|
| 112 |
)
|
| 113 |
|
| 114 |
model = get_model(params['model'], params)
|
| 115 |
-
print(model.hparams)
|
| 116 |
model.df_test_path = params['df_test_path']
|
| 117 |
model.external_test = True
|
| 118 |
model.hparams['use_fp'] = False
|
|
@@ -121,9 +121,9 @@ def run_inference(params):
|
|
| 121 |
|
| 122 |
# Init trainer
|
| 123 |
trainer = Trainer(
|
| 124 |
-
accelerator=
|
| 125 |
-
devices=
|
| 126 |
-
default_root_dir=params['experiment_dir']
|
| 127 |
)
|
| 128 |
|
| 129 |
# Prepare data module to test
|
|
@@ -142,5 +142,4 @@ if __name__ == "__main__":
|
|
| 142 |
mass_diff_thresh = 20
|
| 143 |
dataset_pth, subformula_dir = preprocess_spectra(mgf_path, model_choice, mass_diff_thresh=mass_diff_thresh)
|
| 144 |
params = setup_config(model_choice, dataset_pth, candidates_pth, subformula_dir)
|
| 145 |
-
print(params)
|
| 146 |
run_inference(params)
|
|
|
|
| 112 |
)
|
| 113 |
|
| 114 |
model = get_model(params['model'], params)
|
| 115 |
+
# print(model.hparams)
|
| 116 |
model.df_test_path = params['df_test_path']
|
| 117 |
model.external_test = True
|
| 118 |
model.hparams['use_fp'] = False
|
|
|
|
| 121 |
|
| 122 |
# Init trainer
|
| 123 |
trainer = Trainer(
|
| 124 |
+
accelerator='cpu',
|
| 125 |
+
devices=1,
|
| 126 |
+
default_root_dir=params['experiment_dir'],
|
| 127 |
)
|
| 128 |
|
| 129 |
# Prepare data module to test
|
|
|
|
| 142 |
mass_diff_thresh = 20
|
| 143 |
dataset_pth, subformula_dir = preprocess_spectra(mgf_path, model_choice, mass_diff_thresh=mass_diff_thresh)
|
| 144 |
params = setup_config(model_choice, dataset_pth, candidates_pth, subformula_dir)
|
|
|
|
| 145 |
run_inference(params)
|