Add get_tokenizer function for Engine class (#1653)
This commit is contained in:
@@ -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