Felipe Maya Muniz commited on
Commit
ecd1842
·
1 Parent(s): 432260f

Deploy FastAPI decoder with model

Browse files
Files changed (2) hide show
  1. index_to_word.json +0 -0
  2. 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
- ### 📄 tokenizer_utils.py
2
- def load_index_to_word():
3
- # Mock de exemplo. Substitua por loading real do seu JSON ou pickle.
4
- return {
5
- 0: "<PAD>",
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()}