Spaces:
Sleeping
Sleeping
wzkariampuzha
commited on
Commit
•
3c6a305
1
Parent(s):
38db4c6
Update app.py
Browse files
app.py
CHANGED
@@ -36,19 +36,15 @@ filtering = st.sidebar.radio("What type of filtering would you like?",('Strict',
|
|
36 |
|
37 |
extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
|
38 |
|
39 |
-
@st.cache(
|
40 |
def load_models():
|
41 |
-
global classify_model_vars
|
42 |
-
global NER_pipeline
|
43 |
-
global entity_classes
|
44 |
-
global GARD_dict
|
45 |
-
global max_length
|
46 |
classify_model_vars = classify_abs.init_classify_model()
|
47 |
NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
|
48 |
GARD_dict, max_length = extract_abs.load_GARD_diseases()
|
49 |
-
|
|
|
50 |
with st.spinner('Loading Epidemiology Models and Dependencies...'):
|
51 |
-
load_models()
|
52 |
st.success('All Models and Dependencies Loaded!')
|
53 |
|
54 |
disease_or_gard_id = st.text_input("Input a rare disease term or GARD ID.")
|
|
|
36 |
|
37 |
extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
|
38 |
|
39 |
+
@st.cache()
|
40 |
def load_models():
|
|
|
|
|
|
|
|
|
|
|
41 |
classify_model_vars = classify_abs.init_classify_model()
|
42 |
NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
|
43 |
GARD_dict, max_length = extract_abs.load_GARD_diseases()
|
44 |
+
return classify_model_vars, NER_pipeline, entity_classes, GARD_dict, max_length
|
45 |
+
|
46 |
with st.spinner('Loading Epidemiology Models and Dependencies...'):
|
47 |
+
classify_model_vars, NER_pipeline, entity_classes, GARD_dict, max_length = load_models()
|
48 |
st.success('All Models and Dependencies Loaded!')
|
49 |
|
50 |
disease_or_gard_id = st.text_input("Input a rare disease term or GARD ID.")
|