-
Notifications
You must be signed in to change notification settings - Fork 973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add paddlenlp tokenizer #2706
base: develop
Are you sure you want to change the base?
add paddlenlp tokenizer #2706
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有几个地方需要确认下。另外就是重要函数、方法的type hints和docstring写清楚,特别是公共接口。docstring风格尽量参考Google Python Style Guide。
import jieba | ||
import numpy as np | ||
import sentencepiece as spm | ||
from paddle.utils import try_import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle和fastdeploy冲突,无法同时安装,因此paddle的导入需要使用lazy_paddle代替,或是在函数内导入:使用 import lazy_paddle as paddle; paddle.try_import
代替,或是将该行代码置于函数内。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体代码逻辑我不太懂,重要的函数、类方法写清楚docstring就行,特别是对外暴露的接口。
paddlex/inference/models_new/common/tokenizer/tokenizer_utils.py
Outdated
Show resolved
Hide resolved
paddlex/inference/models_new/common/tokenizer/tokenizer_utils.py
Outdated
Show resolved
Hide resolved
import json | ||
import os | ||
|
||
# import shutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
调试的代码删掉吧
add paddlenlp tokenizer