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

Support gr.LoginButton for gr.load() #10577

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Support gr.LoginButton for gr.load() #10577

wants to merge 15 commits into from

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Feb 12, 2025

Test with:

import gradio as gr

with gr.Blocks() as demo:
    button = gr.LoginButton("Sign in to use your Hugging Face Token")
    with gr.Column(variant="panel"):
        gr.load("distilbert/distilbert-base-uncased", accept_token=button, src="models")
    
demo.launch()
image

Or on Spaces: https://huggingface.co/spaces/abidlabs/login-load

Closes: #10543

More context: https://github.com/huggingface-internal/moon-landing/issues/12460#issuecomment-2648148706, cc @julien-c @kefranabg

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Feb 12, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/c2a86db3d10441fb9eb1d1efacff07b0f2cdff2d/gradio-5.16.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@c2a86db3d10441fb9eb1d1efacff07b0f2cdff2d#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/c2a86db3d10441fb9eb1d1efacff07b0f2cdff2d/gradio-client-1.12.0.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/c2a86db3d10441fb9eb1d1efacff07b0f2cdff2d/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Feb 12, 2025

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Support gr.LoginButton for gr.load()

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@freddyaboulton
Copy link
Collaborator

Is this ready for review?

@abidlabs
Copy link
Member Author

Still doing some testing, but hopefully soon!

@abidlabs
Copy link
Member Author

Ok I'm opening this up for review. There seems to be a separate issue with HF Inference API not working through Spaces, but it seems unrelated to this PR...

@abidlabs abidlabs marked this pull request as ready for review February 12, 2025 20:59
@abidlabs
Copy link
Member Author

Ok there are a few strange issues going on with gr.load() on Spaces. Let me just fix them in this PR so we have a real end-to-end test we can do.

@abidlabs abidlabs marked this pull request as draft February 12, 2025 21:41
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.

Support logging in with HF OAuth in gr.load()
3 participants