Skip to content

Commit 32ff64b

Browse files
committed
add python script to export constants to json
1 parent ba800d9 commit 32ff64b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import json
2+
3+
from chebai.preprocessing.reader import (
4+
CLS_TOKEN,
5+
EMBEDDING_OFFSET,
6+
MASK_TOKEN_INDEX,
7+
PADDING_TOKEN_INDEX,
8+
)
9+
10+
# Define the constants you want to export
11+
# Any changes in the key names here should also follow the same change in verify_constants.yml code
12+
constants = {
13+
"EMBEDDING_OFFSET": EMBEDDING_OFFSET,
14+
"CLS_TOKEN": CLS_TOKEN,
15+
"PADDING_TOKEN_INDEX": PADDING_TOKEN_INDEX,
16+
"MASK_TOKEN_INDEX": MASK_TOKEN_INDEX,
17+
}
18+
19+
if __name__ == "__main__":
20+
# Write constants to a JSON file
21+
with open("constants.json", "w") as f:
22+
json.dump(constants, f)

0 commit comments

Comments
 (0)