Update main.py
Browse files
main.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import matplotlib
|
| 2 |
from itertools import chain
|
| 3 |
import os
|
|
|
|
| 4 |
import re
|
| 5 |
import hnswlib
|
| 6 |
import string
|
|
@@ -52,7 +53,7 @@ default_index_negative = 'data/references_index_negative_spec2vec.bin'
|
|
| 52 |
default_reference_positive = 'data/references_spectrums_positive.pickle'
|
| 53 |
default_reference_negative = 'data/references_spectrums_negative.pickle'
|
| 54 |
print('Start Loading database')
|
| 55 |
-
default_database = pd.read_csv('data/DeepMassStructureDB-v1.0.csv')
|
| 56 |
print('Start Loading Word2Vec')
|
| 57 |
deepmass_positive = Word2Vec.load("model/Ms2Vec_allGNPSpositive.hdf5")
|
| 58 |
deepmass_negative = Word2Vec.load("model/Ms2Vec_allGNPSnegative.hdf5")
|
|
@@ -439,7 +440,7 @@ with gr.Blocks(title='DeepMS 2') as demo:
|
|
| 439 |
]
|
| 440 |
)
|
| 441 |
run_matchms_btn.click(
|
| 442 |
-
fn=
|
| 443 |
inputs=[res_state],
|
| 444 |
outputs=[
|
| 445 |
res_state,
|
|
@@ -481,8 +482,8 @@ with gr.Blocks(title='DeepMS 2') as demo:
|
|
| 481 |
outputs=[download]
|
| 482 |
)
|
| 483 |
|
| 484 |
-
|
| 485 |
-
demo.launch()
|
| 486 |
|
| 487 |
|
| 488 |
|
|
|
|
| 1 |
import matplotlib
|
| 2 |
from itertools import chain
|
| 3 |
import os
|
| 4 |
+
os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
|
| 5 |
import re
|
| 6 |
import hnswlib
|
| 7 |
import string
|
|
|
|
| 53 |
default_reference_positive = 'data/references_spectrums_positive.pickle'
|
| 54 |
default_reference_negative = 'data/references_spectrums_negative.pickle'
|
| 55 |
print('Start Loading database')
|
| 56 |
+
default_database = pd.read_csv('data/DeepMassStructureDB-v1.0.csv', low_memory=False)
|
| 57 |
print('Start Loading Word2Vec')
|
| 58 |
deepmass_positive = Word2Vec.load("model/Ms2Vec_allGNPSpositive.hdf5")
|
| 59 |
deepmass_negative = Word2Vec.load("model/Ms2Vec_allGNPSnegative.hdf5")
|
|
|
|
| 440 |
]
|
| 441 |
)
|
| 442 |
run_matchms_btn.click(
|
| 443 |
+
fn=click_matchms_fn,
|
| 444 |
inputs=[res_state],
|
| 445 |
outputs=[
|
| 446 |
res_state,
|
|
|
|
| 482 |
outputs=[download]
|
| 483 |
)
|
| 484 |
|
| 485 |
+
if __name__ == '__main__':
|
| 486 |
+
demo.launch()
|
| 487 |
|
| 488 |
|
| 489 |
|