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

Update hfh #700

Merged
merged 4 commits into from
Jan 25, 2023
Merged

Update hfh #700

merged 4 commits into from
Jan 25, 2023

Conversation

severo
Copy link
Collaborator

@severo severo commented Jan 25, 2023

In particular: we now use the new list_repo_refs method, and the new revision parameter when we create the refs/convert/parquet branch.

@severo severo requested a review from Wauplin January 25, 2023 13:54
Copy link

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Looks good to me! :)

Out of curiosity, how to you get the source_revision (which I guess is the initial commit) ? We have a user that wants to retrieve this information programmatically but for now we don't have a endpoint for that so I'd be interested if a workaround exists for it :)

@severo
Copy link
Collaborator Author

severo commented Jan 25, 2023

how to you get the source_revision

Oh, for now, it's hard-coded to "main" (can be set to another value with an environment variable, but still: it's a constant).

And it's not really useful to create the branch from main or from any other commit, since the first action is to delete all the contents, before adding the files we are interested in (parquet files).

The source_revision reference, in our case, is used to know the commit that will be converted to parquet.

@severo severo merged commit 55063e1 into main Jan 25, 2023
@severo severo deleted the update-hfh branch January 25, 2023 14:22
@Wauplin
Copy link

Wauplin commented Jan 25, 2023

Oh, for now, it's hard-coded to "main" (can be set to another value with an environment variable, but still: it's a constant)
And it's not really useful to create the branch from main or from any other commit, since the first action is to delete all the contents, before adding the files we are interested in (parquet files).

Oh ok, makes sense. I thought you had a trick to know the initial commit.
If (or when?) it's ever possible, it would allow you to skip the "delete all" step before uploading parquet files. But that will be for later.

@severo
Copy link
Collaborator Author

severo commented Jan 25, 2023

Yes, that's what I mentioned in the commit message: 5364f81

Maybe we will want to change this later once huggingface/huggingface_hub#1288 is fixed.

@julien-c
Copy link
Member

if you just want an empty tree (and not the initial commit of the repo), you can also create a commit completely detached from any branch (i think we discussed this in the other issue but i don't remember the discusion)

@Wauplin
Copy link

Wauplin commented Jan 25, 2023

you can also create a commit completely detached from any branch

Could be a solution but not implemented via the HTTP endpoint so far.
I'm personally not sure it's a good idea as the .gitattributes file would be lost which is I think a very important one.

@julien-c
Copy link
Member

(yes, but you could re-add a "standard" gitattributes quite easily in your commit i guess)

@julien-c
Copy link
Member

(i do agree with you, this is just for the sake of discussion)

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.

3 participants