Spaces:
Sleeping
Sleeping
Felipe Maya Muniz commited on
Commit ·
ecd1842
1
Parent(s): 432260f
Deploy FastAPI decoder with model
Browse files- index_to_word.json +0 -0
- tokenizer_utils.py +5 -12
index_to_word.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_utils.py
CHANGED
|
@@ -1,12 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
1: "hello",
|
| 7 |
-
2: "world",
|
| 8 |
-
3: "sage",
|
| 9 |
-
4: "is",
|
| 10 |
-
5: "thinking",
|
| 11 |
-
|
| 12 |
-
}
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
|
| 3 |
+
def load_index_to_word(path="index_to_word.json"):
|
| 4 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 5 |
+
return {int(k): v for k, v in json.load(f).items()}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|