Skip to content
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

metadata_update: work on a copy of the upstream file, to not mess up the cache #891

Merged
merged 4 commits into from
Jun 10, 2022

Conversation

julien-c
Copy link
Member

@julien-c julien-c commented Jun 1, 2022

otherwise if you're using the same file from another script or library you'll have incorect file.

Side effect: With this change, we can probably remove the flag force_download=True

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 1, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please write a test for this?

@julien-c
Copy link
Member Author

julien-c commented Jun 3, 2022

not sure what to test here TBH =)

@adrinjalali
Copy link
Contributor

not sure what to test here TBH =)

  • Download repo (which also caches it)
  • change the metadata/work with it
  • make sure the cached file hasn't changed

Isn't that what this PR enables?

@julien-c
Copy link
Member Author

julien-c commented Jun 3, 2022

Ok, makes sense. Want to take a stab at it @adrinjalali?

@adrinjalali
Copy link
Contributor

Too many things on my plat ATM. I'll leave it to your more than capable hands, or @LysandreJik if he's interested :)

@LysandreJik
Copy link
Member

Pushed a quick test

Copy link
Contributor

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests @LysandreJik

f"{USER}/{self.REPO_NAME}", new_metadata, token=self._token, overwrite=True
)

self.assertNotEqual(metadata_load(path), new_metadata)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also check the original file is not touched?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled in 5fabdf8

@LysandreJik LysandreJik added this to the v0.8 milestone Jun 10, 2022
@LysandreJik LysandreJik mentioned this pull request Jun 10, 2022
Copy link
Contributor

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @LysandreJik

@adrinjalali adrinjalali merged commit 8994fd3 into main Jun 10, 2022
@adrinjalali adrinjalali deleted the tiny-nit-801 branch June 10, 2022 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants