Ancastal commited on
Commit
7f689fa
·
verified ·
1 Parent(s): 463aee7

Update run_gui.py

Browse files
Files changed (1) hide show
  1. run_gui.py +12 -0
run_gui.py CHANGED
@@ -14,6 +14,18 @@ Usage:
14
  python run_gui.py --debug # Enable debug mode
15
  """
16
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  import sys
18
  import os
19
  import argparse
 
14
  python run_gui.py --debug # Enable debug mode
15
  """
16
 
17
+ import spacy
18
+ import subprocess
19
+ import importlib.util
20
+
21
+ def is_model_installed(model_name):
22
+ return importlib.util.find_spec(model_name) is not None
23
+
24
+ model = "en_core_web_sm"
25
+
26
+ if not is_model_installed(model):
27
+ subprocess.run(["python", "-m", "spacy", "download", model])
28
+
29
  import sys
30
  import os
31
  import argparse