Skip to content

try main if tag does not work#322

Merged
lvwerra merged 1 commit into
mainfrom
fix-hub-versioning-2
Oct 13, 2022
Merged

try main if tag does not work#322
lvwerra merged 1 commit into
mainfrom
fix-hub-versioning-2

Conversation

@lvwerra

@lvwerra lvwerra commented Oct 12, 2022

Copy link
Copy Markdown
Member

The previous fix #314 ignores the fact that some repos (especially community) might not have tags. We should fall back to main in that case.

@lvwerra
lvwerra requested a review from lhoestq October 12, 2022 14:04
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Oct 12, 2022

Copy link
Copy Markdown

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

@lhoestq lhoestq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good catch ^^

Though if the user explicitly passed revision I don't think we should try main

@lvwerra

lvwerra commented Oct 12, 2022

Copy link
Copy Markdown
Member Author

The attribute self.revision contains what the users passed and if it's None then we don't try to go for main if the initial attempt failed:

if self.revision is None and os.getenv("HF_SCRIPTS_VERSION", SCRIPTS_VERSION) != "main":

So I think we should never overwrite whatever the user explicitly passed. Does that make sense?

@lhoestq lhoestq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry I misread your code, LGTM !

@lvwerra
lvwerra merged commit cb2a7f0 into main Oct 13, 2022
@lvwerra
lvwerra deleted the fix-hub-versioning-2 branch October 13, 2022 11:50
NimaBoscarino pushed a commit that referenced this pull request Oct 17, 2022
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