arssite commited on
Commit
9b9dee3
1 Parent(s): 1f0dd44

Update ResumeOpt.py

Browse files
Files changed (1) hide show
  1. ResumeOpt.py +6 -2
ResumeOpt.py CHANGED
@@ -3,13 +3,17 @@ from transformers import pipeline
3
  import spacy
4
  from docx import Document
5
  import tempfile
6
- if not os.path.exists("en_core_web_sm-3.0.0"):
 
 
 
7
  import subprocess
8
  subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
 
9
 
10
  #nlp = spacy.load('en_core_web_sm')
11
  # Load models quietly
12
- nlp = spacy.load('en_core_web_sm')
13
  fill_mask = pipeline("fill-mask", model="bert-base-uncased", device=0) # Use GPU if available
14
 
15
  # Cell 3: Define functions
 
3
  import spacy
4
  from docx import Document
5
  import tempfile
6
+ import os
7
+ try:
8
+ nlp = spacy.load('en_core_web_sm')
9
+ except IOError:
10
  import subprocess
11
  subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
12
+ nlp = spacy.load('en_core_web_sm')
13
 
14
  #nlp = spacy.load('en_core_web_sm')
15
  # Load models quietly
16
+ #nlp = spacy.load('en_core_web_sm')
17
  fill_mask = pipeline("fill-mask", model="bert-base-uncased", device=0) # Use GPU if available
18
 
19
  # Cell 3: Define functions