Skip to content

Commit

Permalink
speed up process of loading config file
Browse files Browse the repository at this point in the history
  • Loading branch information
lovemefan committed Aug 9, 2023
1 parent 8184668 commit 7369396
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Binary file added cttpunctuator/src/onnx/punc.bin
Binary file not shown.
4 changes: 3 additions & 1 deletion cttpunctuator/src/punctuator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os.path
import pickle
import platform
from pathlib import Path
from typing import Tuple, Union
Expand Down Expand Up @@ -39,7 +40,8 @@ def __init__(
if quantize:
model_file = os.path.join(model_dir, "model_quant.onnx")
config_file = os.path.join(model_dir, "punc.yaml")
config = read_yaml(config_file)
with open(config_file, 'rb') as file:
config = pickle.load(file)

self.converter = TokenIDConverter(config["token_list"])
self.ort_infer = OrtInferSession(
Expand Down

0 comments on commit 7369396

Please sign in to comment.