-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HF] Implement save_to_hf_hub for Model and Tokenizer #3982
Conversation
Thanks for your contribution! |
) | ||
|
||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
# First create the repo (and clone its content if it's nonempty). |
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.
我这边有几个问题:
- 如果 repo 里面本身就有大文件,clone下载就会很慢?
- 如果在 clone 的过程由于时间过程失败了,那由于是创建的临时文件夹每次都得重来,是否会浪费时间,如果这个 tmp_dir能够指定是否更好呢?
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.
你说的有道理。我新的实现取消了clone, 并且更换为http request
|
||
if len(large_files) > 0: | ||
logger.info("Track files with git lfs: {}".format(", ".join(large_files))) | ||
repo.lfs_track(large_files) |
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.
git lfs
是需要安装对应的包的,这里是否需要提供检测lsf是否存在并抛一个安装的 warning 呢?
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.
已替换为http request
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.
Looks very nice!
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.
Hi @sijunhe , PR looks good to me ! :)
I have added 2 comments as you don't need to check for token
in the HfFolder
(that's a bit too "low-level" for an external library).
Co-authored-by: Lucain <lucainp@gmail.com>
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.
(nit) HfFolder
is not used anymore. Sorry, forgot about it in previous review :)
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.
LGTM
PR types
New features
PR changes
APIs
Description