Spaces:
GIZ
/
Running on CPU Upgrade

prashant commited on
Commit
ca8d27c
1 Parent(s): 5c238c3

conditional import

Browse files
Files changed (1) hide show
  1. utils/lexical_search.py +5 -1
utils/lexical_search.py CHANGED
@@ -3,7 +3,6 @@ from haystack.document_stores import InMemoryDocumentStore
3
  import spacy
4
  import re
5
  from spacy.matcher import Matcher
6
- from termcolor import colored
7
  import streamlit as st
8
  from markdown import markdown
9
  from annotated_text import annotation
@@ -13,9 +12,14 @@ from utils.preprocessing import processingpipeline
13
  from utils.streamlitcheck import check_streamlit
14
  import configparser
15
  import logging
 
 
 
 
16
 
17
  try:
18
  import streamlit as st
 
19
  except ImportError:
20
  logging.info("Streamlit not installed")
21
  config = configparser.ConfigParser()
 
3
  import spacy
4
  import re
5
  from spacy.matcher import Matcher
 
6
  import streamlit as st
7
  from markdown import markdown
8
  from annotated_text import annotation
 
12
  from utils.streamlitcheck import check_streamlit
13
  import configparser
14
  import logging
15
+ try:
16
+ from termcolor import colored
17
+ except:
18
+ pass
19
 
20
  try:
21
  import streamlit as st
22
+
23
  except ImportError:
24
  logging.info("Streamlit not installed")
25
  config = configparser.ConfigParser()