edwjin commited on
Commit
727198a
·
verified ·
1 Parent(s): 405af30

Swap dictionary key-value pair

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -29,7 +29,8 @@ tokenizer = None
29
  pres_dict = {}
30
 
31
  with open('pres_dict.pkl', 'rb') as file:
32
- pres_dict = pickle.load(file)
 
33
 
34
  def initialize():
35
  global model, tokenizer
 
29
  pres_dict = {}
30
 
31
  with open('pres_dict.pkl', 'rb') as file:
32
+ reversed_dict = pickle.load(file)
33
+ pres_dict = {value: key for key, value in reversed_dict.items()}
34
 
35
  def initialize():
36
  global model, tokenizer