Spaces:
Sleeping
Sleeping
Swap dictionary key-value pair
Browse files
app.py
CHANGED
|
@@ -29,7 +29,8 @@ tokenizer = None
|
|
| 29 |
pres_dict = {}
|
| 30 |
|
| 31 |
with open('pres_dict.pkl', 'rb') as file:
|
| 32 |
-
|
|
|
|
| 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
|