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

Remember token locally with gr.load() #9966

Merged
merged 61 commits into from
Nov 15, 2024
Merged

Remember token locally with gr.load() #9966

merged 61 commits into from
Nov 15, 2024

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Nov 15, 2024

This PR now adds a "Remember me" checkbox to gr.load() when accept_token=True. The token is stored in local storage using the new gr.BrowserState demo. Here's a video of it in action (you'll notice some other UI updates as well):

Screen.Recording.2024-11-15.at.12.55.46.PM.mov

Includes a test demo: demo/load_model_with_token/run.py but this should also work with any of our gr.load integrations as well. cc @AK391 @yvrjsharma

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Nov 15, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detecting...

Install Gradio from this PR

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

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/a1f2b457e652039e59f7067a65febf8e3af35508/gradio-client-1.7.1.tgz

Use Lite from this PR

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

@abidlabs abidlabs changed the base branch from main to localstate November 15, 2024 19:52
Base automatically changed from localstate to main November 15, 2024 20:56
@abidlabs abidlabs marked this pull request as ready for review November 15, 2024 20:58
gradio/external.py Outdated Show resolved Hide resolved
@abidlabs abidlabs added the v: patch A change that requires a patch release label Nov 15, 2024
Copy link
Collaborator

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

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

lgtm!

@abidlabs
Copy link
Member Author

Thanks @aliabid94!

@abidlabs abidlabs merged commit da6f191 into main Nov 15, 2024
22 checks passed
@abidlabs abidlabs deleted the save-local-token branch November 15, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants