-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[Examples] Update with HFApi #5393
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
Conversation
julien-c
left a comment
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.
nice! cc @Wauplin
pcuenca
left a comment
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.
Very nice, thanks for dealing with it so fast @sayakpaul!
There's still a missing replacement in the korean translation of the docs:
| >>> from huggingface_hub import HfFolder, Repository, whoami |
|
The documentation is not available anymore as the PR was closed or merged. |
|
Will merge when the CI tells me so! |
Wauplin
left a comment
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.
Hey @sayakpaul thanks a lot for working on that! Love the fact that Repository is completely removed by this PR! 😍 I'm sorry I did not review it before (wanted to do it carefully).
I have spotted a few inconsistencies in the changes. For the run_as_future=True I am not sure if this is a bug or made on purpose. For the repo_id = create_repo(...) thingy it would have to be changed (otherwise it cannot work). Would you mind opening a followup PR for that? Thank you in advance!
| ... repo_id = create_repo( | ||
| ... repo_id=config.hub_model_id or Path(config.output_dir).name, exist_ok=True | ||
| ... ) |
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_id = create_repo( | |
| ... repo_id=config.hub_model_id or Path(config.output_dir).name, exist_ok=True | |
| ... ) | |
| ... repo_id = create_repo( | |
| ... repo_id=config.hub_model_id or Path(config.output_dir).name, exist_ok=True | |
| ... ).repo_id |
Create_repo returns a RepoUrl object. To get the id, you need to do create_repo(...).repo_id
| ... repo_id = create_repo( | ||
| ... repo_id=config.hub_model_id or Path(config.output_dir).name, exist_ok=True | ||
| ... ) |
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_id = create_repo( | |
| ... repo_id=config.hub_model_id or Path(config.output_dir).name, exist_ok=True | |
| ... ) | |
| ... repo_id = create_repo( | |
| ... repo_id=config.hub_model_id or Path(config.output_dir).name, exist_ok=True | |
| ... ).repo_id |
Create_repo returns a RepoUrl object. To get the id, you need to do create_repo(...).repo_id
| ignore_patterns=["step_*", "epoch_*"], | ||
| ) |
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.
| ignore_patterns=["step_*", "epoch_*"], | |
| ) | |
| ignore_patterns=["step_*", "epoch_*"], | |
| run_as_future=True, | |
| ) |
It looks like before blocking=False was used, meaning we would need to use run_as_future=True here to keep the same behavior.
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.
I think it's okay as is because this is what we follow for the rest of the examples:
| upload_folder( |
See here for additional reference:
#2934
| ignore_patterns=["step_*", "epoch_*"], | ||
| ) |
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.
| ignore_patterns=["step_*", "epoch_*"], | |
| ) | |
| ignore_patterns=["step_*", "epoch_*"], | |
| run_as_future=True, | |
| ) |
It looks like before blocking=False was used, meaning we would need to use run_as_future=True here to keep the same behavior.
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.
Same as before.
| ignore_patterns=["step_*", "epoch_*"], | ||
| ) |
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.
| ignore_patterns=["step_*", "epoch_*"], | |
| ) | |
| ignore_patterns=["step_*", "epoch_*"], | |
| run_as_future=True, | |
| ) |
It looks like before blocking=False was used, meaning we would need to use run_as_future=True here to keep the same behavior.
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.
Same as before.
| ignore_patterns=["step_*", "epoch_*"], | ||
| ) |
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.
| ignore_patterns=["step_*", "epoch_*"], | |
| ) | |
| ignore_patterns=["step_*", "epoch_*"], | |
| run_as_future=True, | |
| ) |
It looks like before blocking=False was used, meaning we would need to use run_as_future=True here to keep the same behavior.
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.
Same as before.
|
Since I just merged, I'd appreciate if you could directly PR :-) |
* fix: create_repo() * Empty-Commit
* update training examples to use HFAPI. * update training example. * reflect the changes in the korean version too. * Empty-Commit
* fix: create_repo() * Empty-Commit
Fixes: #5383.
@stevhliu cc for the doc change.
@Wauplin for visibility and awareness.