marmg commited on
Commit
89b2c4c
1 Parent(s): ba47546

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -9,6 +9,7 @@ st.set_page_config(
9
 
10
  import os
11
  import sys
 
12
 
13
  import spacy
14
  from zshot.linker import LinkerSMXM, LinkerTARS, LinkerRegen
@@ -21,6 +22,8 @@ from spacy import displacy
21
  sys.path.append(os.path.abspath('./'))
22
  import streamlit_apps_config as config
23
 
 
 
24
  ## Marking down NER Style
25
  st.markdown(config.STYLE_CONFIG, unsafe_allow_html=True)
26
 
@@ -39,14 +42,14 @@ st.markdown(hide_menu_style, unsafe_allow_html=True)
39
  import base64
40
 
41
 
42
- @st.cache(allow_output_mutation=True)
43
  def get_base64_of_bin_file(bin_file):
44
  with open(bin_file, 'rb') as f:
45
  data = f.read()
46
  return base64.b64encode(data).decode()
47
 
48
 
49
- @st.cache(allow_output_mutation=True)
50
  def get_img_with_href(local_img_path, target_url, size='big'):
51
  img_format = os.path.splitext(local_img_path)[-1].replace('.', '')
52
  bin_str = get_base64_of_bin_file(local_img_path)
 
9
 
10
  import os
11
  import sys
12
+ import warnings
13
 
14
  import spacy
15
  from zshot.linker import LinkerSMXM, LinkerTARS, LinkerRegen
 
22
  sys.path.append(os.path.abspath('./'))
23
  import streamlit_apps_config as config
24
 
25
+ warnings.simplefilter('ignore')
26
+
27
  ## Marking down NER Style
28
  st.markdown(config.STYLE_CONFIG, unsafe_allow_html=True)
29
 
 
42
  import base64
43
 
44
 
45
+ @st.cache_data(allow_output_mutation=True)
46
  def get_base64_of_bin_file(bin_file):
47
  with open(bin_file, 'rb') as f:
48
  data = f.read()
49
  return base64.b64encode(data).decode()
50
 
51
 
52
+ @st.cache_data(allow_output_mutation=True)
53
  def get_img_with_href(local_img_path, target_url, size='big'):
54
  img_format = os.path.splitext(local_img_path)[-1].replace('.', '')
55
  bin_str = get_base64_of_bin_file(local_img_path)