Kevin Hu commited on
Commit
149b3bf
·
1 Parent(s): 8f229c1

resolve halt while starting up (#3397)

Browse files

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (2) hide show
  1. api/validation.py +3 -2
  2. rag/nlp/rag_tokenizer.py +0 -1
api/validation.py CHANGED
@@ -17,6 +17,7 @@
17
  import sys
18
  from api.utils.log_utils import logger
19
 
 
20
  def python_version_validation():
21
  # Check python version
22
  required_python_version = (3, 10)
@@ -33,5 +34,5 @@ python_version_validation()
33
 
34
  # Download nltk data
35
  import nltk
36
- nltk.download('wordnet')
37
- nltk.download('punkt_tab')
 
17
  import sys
18
  from api.utils.log_utils import logger
19
 
20
+
21
  def python_version_validation():
22
  # Check python version
23
  required_python_version = (3, 10)
 
34
 
35
  # Download nltk data
36
  import nltk
37
+ nltk.download('wordnet', halt_on_error=False, quiet=True)
38
+ nltk.download('punkt_tab', halt_on_error=False, quiet=True)
rag/nlp/rag_tokenizer.py CHANGED
@@ -55,7 +55,6 @@ class RagTokenizer:
55
  except Exception:
56
  logger.exception(f"[HUQIE]:Build trie {fnm} failed")
57
 
58
-
59
  def __init__(self, debug=False):
60
  self.DEBUG = debug
61
  self.DENOMINATOR = 1000000
 
55
  except Exception:
56
  logger.exception(f"[HUQIE]:Build trie {fnm} failed")
57
 
 
58
  def __init__(self, debug=False):
59
  self.DEBUG = debug
60
  self.DENOMINATOR = 1000000