Add get_tokenizer function for Engine class (#1653)
This commit is contained in:
1 parent
9da5a60b18
commit
31fad29ab0
1 file changed
+8
@@ -809,4 +809,12 @@ class Engine:
|
|||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
kill_child_process(os.getpid(), including_parent=False)
|
kill_child_process(os.getpid(), including_parent=False)
|
||||||
|
|
||||||
|
def get_tokenizer(self):
|
||||||
|
global tokenizer_manager
|
||||||
|
|
||||||
|
if tokenizer_manager is None:
|
||||||
|
raise ReferenceError("Tokenizer Manager is not initialized.")
|
||||||
|
else:
|
||||||
|
return tokenizer_manager.tokenizer
|
||||||
|
|
||||||
# TODO (ByronHsu): encode
|
# TODO (ByronHsu): encode
|
||||||
Reference in new issue
Block a user