Johnny commited on
Commit
7cf7e72
·
1 Parent(s): 63c5dba

fixed spacy model download

Browse files
Files changed (2) hide show
  1. requirements.txt +1 -1
  2. utils.py +6 -1
requirements.txt CHANGED
@@ -5,5 +5,5 @@ supabase
5
  PyMuPDF
6
  pytest
7
  sentence-transformers
8
- spacy && python -m spacy download en_core_web_sm
9
  fuzzywuzzy
 
5
  PyMuPDF
6
  pytest
7
  sentence-transformers
8
+ spacy
9
  fuzzywuzzy
utils.py CHANGED
@@ -14,11 +14,16 @@ from collections import Counter
14
  from sklearn.feature_extraction.text import TfidfVectorizer
15
  import streamlit as st
16
  from fuzzywuzzy import fuzz
 
17
 
18
  # These functions will be called in the app.py file
19
 
20
  # Load spaCy NLP model
21
- nlp = spacy.load("en_core_web_sm")
 
 
 
 
22
 
23
  def evaluate_resumes(uploaded_files, job_description, min_keyword_match=2):
24
  """Evaluates uploaded resumes, filters by keywords and score, and returns shortlisted candidates."""
 
14
  from sklearn.feature_extraction.text import TfidfVectorizer
15
  import streamlit as st
16
  from fuzzywuzzy import fuzz
17
+ import subprocess
18
 
19
  # These functions will be called in the app.py file
20
 
21
  # Load spaCy NLP model
22
+ try:
23
+ nlp = spacy.load("en_core_web_sm")
24
+ except OSError:
25
+ subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
26
+ nlp = spacy.load("en_core_web_sm")
27
 
28
  def evaluate_resumes(uploaded_files, job_description, min_keyword_match=2):
29
  """Evaluates uploaded resumes, filters by keywords and score, and returns shortlisted candidates."""