Tao Wu commited on
Commit
51e1871
1 Parent(s): b3d1a27

replace redis

Browse files
.gitattributes CHANGED
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  *.csv filter=lfs diff=lfs merge=lfs -text
37
  *.sqlite3 filter=lfs diff=lfs merge=lfs -text
38
  *.rdb filter=lfs diff=lfs merge=lfs -text
 
 
36
  *.csv filter=lfs diff=lfs merge=lfs -text
37
  *.sqlite3 filter=lfs diff=lfs merge=lfs -text
38
  *.rdb filter=lfs diff=lfs merge=lfs -text
39
+ *.json filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -1,4 +1,5 @@
1
  __pycache__/
2
  app-data/
3
  redis-data/
4
- k8s/
 
 
1
  __pycache__/
2
  app-data/
3
  redis-data/
4
+ k8s/
5
+ *.rdb
app/app.py CHANGED
@@ -6,8 +6,10 @@ import requests
6
  from config import *
7
  from embedding_setup import retriever, find_similar_occupation
8
  from data_process import build_skill_query, get_occupations_from_csv, get_courses_from_BA, get_occupation_detial, build_occupation_query
 
 
 
9
 
10
- r = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB, decode_responses=True)
11
  skill_details_mapping = {}
12
 
13
 
@@ -111,7 +113,8 @@ def get_candidate_courses(occupation, skills):
111
 
112
 
113
  def get_occupation_skills(oc_uri):
114
- skills_json = r.get(oc_uri)
 
115
  skill_labels = []
116
  if skills_json:
117
  skills = json.loads(skills_json)
 
6
  from config import *
7
  from embedding_setup import retriever, find_similar_occupation
8
  from data_process import build_skill_query, get_occupations_from_csv, get_courses_from_BA, get_occupation_detial, build_occupation_query
9
+ with open('/app/data/redis_data.json', 'r') as file:
10
+ data_dict = json.load(file)
11
+ #r = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB, decode_responses=True)
12
 
 
13
  skill_details_mapping = {}
14
 
15
 
 
113
 
114
 
115
  def get_occupation_skills(oc_uri):
116
+ #skills_json = r.get(oc_uri)
117
+ skills_json = data_dict.get(oc_uri, None)
118
  skill_labels = []
119
  if skills_json:
120
  skills = json.loads(skills_json)
dump.rdb → app/data/redis_data.json RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5cb8c9201e80c410d2aac9451678528f6e9a4311dd815a2a167b98663fd42639
3
- size 48413568
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a01eb57f05a046beff74f8bdf2126a24a3996c0ffdeaaa444c423aaa40ee2e4
3
+ size 117289041