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

Guide users to install huggingface-cli to login to huggingface #645

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

pbabinca
Copy link
Contributor

@pbabinca pbabinca commented Jan 28, 2025

Relates-to: #643

Summary by Sourcery

Documentation:

  • Document the requirement for the huggingface-cli tool when logging in to Hugging Face.

Copy link
Contributor

sourcery-ai bot commented Jan 28, 2025

Reviewer's Guide by Sourcery

This pull request adds a note to the documentation that the huggingface-cli tool is required to login to huggingface. It also adds a link to the huggingface documentation on how to install and use the tool.

Sequence diagram for Huggingface login flow

sequenceDiagram
    actor User
    participant CLI as Ramalama CLI
    participant HF as huggingface-cli
    participant Hub as Huggingface Hub

    User->>CLI: ramalama login --token=XYZ huggingface
    Note over CLI: Requires huggingface-cli
    CLI->>HF: Use huggingface-cli
    HF->>Hub: Authenticate with token
    Hub-->>HF: Authentication response
    HF-->>CLI: Authentication result
    CLI-->>User: Login status
Loading

File-Level Changes

Change Details Files
Added a note to the documentation that the huggingface-cli tool is required to login to huggingface.
  • Added a sentence to the documentation that the huggingface-cli tool is required to login to huggingface.
  • Added a link to the huggingface documentation on how to install and use the tool.
docs/ramalama-login.1.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @pbabinca - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The link format contains an extra parenthesis - please change ]: (https... to ]: https...
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

docs/ramalama-login.1.md Outdated Show resolved Hide resolved
@rhatdan
Copy link
Member

rhatdan commented Jan 28, 2025

Thanks @pbabinca
Please sign and squash your commits.

@ericcurtin
Copy link
Collaborator

Might need to do a squash also, a problem with committing the bots suggestions in the web ui, is the bot can't sign a commit under someones name.

@ericcurtin
Copy link
Collaborator

CI also complained we use invalid syntax in the docs, we need to fix that:

hack/xref-helpmsgs-manpages
xref-helpmsgs-manpages: docs/ramalama-login.1.md:56: '[documentation of Command Line Interface (CLI) of Hub Python Library on Hugging Face]: (https://huggingface.co/docs/huggingface_hub/en/guides/cli)' should be bracketed by '**'
make: *** [Makefile:110: validate] Error 1
Error: Process completed with exit code 2.

@pbabinca
Copy link
Contributor Author

CI also complained we use invalid syntax in the docs, we need to fix that:

Well, this is tricky. I thought of providing link to documentation and locally the change rendered correctly:

Screenshot From 2025-01-29 10-44-59

hack/xref-helpmsgs-manpages
xref-helpmsgs-manpages: docs/ramalama-login.1.md:56: '[documentation of Command Line Interface (CLI) of Hub Python Library on Hugging Face]: (https://huggingface.co/docs/huggingface_hub/en/guides/cli)' should be bracketed by '**'
make: *** [Makefile:110: validate] Error 1
Error: Process completed with exit code 2.

This one suggest use of brackets by **. But that does not make sense here because link ends up to be inline (see screenshot above) and the sourcery-ai suggests removal of column : but that would break inline link:

## SEE ALSO
**[ramalama(1)](ramalama.1.md)**

**[documentation of Command Line Interface (CLI) of Hub Python Library on Hugging Face](https://huggingface.co/docs/huggingface_hub/en/guides/cli)**

Ends up to be:
Screenshot From 2025-01-29 10-49-52

I haven't found external hyperlinks in ramalama nor podman so I'm not sure what would be preferred way to make CI happy.

Do you have any suggestions how to approach this?

@@ -49,9 +49,11 @@ Login to huggingface registry
```
$ ramalama login --token=XYZ huggingface
```
Logging in to Hugging Face requires the `huggingface-cli` tool. For installation and usage instructions, see the [documentation of Command Line Interface (CLI) of Hub Python Library on Hugging Face].
Copy link
Member

@rhatdan rhatdan Jan 29, 2025

Choose a reason for hiding this comment

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

Logging in to Hugging Face requires the `huggingface-cli` tool. For installation and usage instructions, see [*documentation of Command Line Interface (CLI) of Hub Python Library on Hugging Face*].


## SEE ALSO
**[ramalama(1)](ramalama.1.md)**
[documentation of Command Line Interface (CLI) of Hub Python Library on Hugging Face]: (https://huggingface.co/docs/huggingface_hub/en/guides/cli)
Copy link
Member

Choose a reason for hiding this comment

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

Add a line break here.

@rhatdan
Copy link
Member

rhatdan commented Jan 29, 2025

Eliminate the SeeAlso section.

And change to:

+Logging in to Hugging Face requires the `huggingface-cli` tool. For installation and usage instructions, see the [*documentation of Command Line Interface CLI of Hub Python Library on Hugging Face*](https://huggingface.co/docs/huggingface_hub/en/guides/cli).

@rhatdan rhatdan closed this Jan 29, 2025
@rhatdan rhatdan reopened this Jan 29, 2025
@pbabinca
Copy link
Contributor Author

Eliminate the SeeAlso section.

And change to:

+Logging in to Hugging Face requires the `huggingface-cli` tool. For installation and usage instructions, see the [*documentation of Command Line Interface CLI of Hub Python Library on Hugging Face*](https://huggingface.co/docs/huggingface_hub/en/guides/cli).

Building this locally as a man page and rendering with it with: make docs && man -l docs/ramalama-login.1 does not display link at all:

Screenshot From 2025-01-29 13-52-43

@pbabinca
Copy link
Contributor Author

My latest attempt to use reference style links seem to pass tests and also renders correctly in man page and that link is even visible there:

Screenshot From 2025-01-29 13-59-25

@rhatdan
Copy link
Member

rhatdan commented Jan 29, 2025

How about:
patch

Relates-to: containers#643

Signed-off-by: Pavol Babincak <[email protected]>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Daniel J Walsh <[email protected]>
@pbabinca
Copy link
Contributor Author

How about: patch

Done and IMHO it still looks fine in man page. 👍

@ericcurtin ericcurtin merged commit 4851d60 into containers:main Jan 29, 2025
11 checks passed
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