8000 allow users to retrieve original Gradio app by sysradium · Pull Request #811 · huggingface/smolagents · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

allow users to retrieve original Gradio app #811

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

sysradium
Copy link
Contributor
@sysradium sysradium commented Feb 26, 2025

Closes #789

This will allow the use of gradio hot reload feature. For example:

# example.py

model = ...
agent = CodeAgent(
    tools=[
        ocr_document,
        ssh_execute_command_with_agent,
        generate_temp_file,
        download_file,
    ],
    model=model,
)

demo = GradioUI(agent).create_app()

if __name__ == "__main__":
    demo.launch(debug=True, share=False)

When launched with:

 gradio example.py 

Will enable gradio hot reload. I.e. any changes to example.py will reload the file and restart a server.

Copy link
Collaborator
@aymeric-roucher aymeric-roucher left a comment

Choose a reason for hiding this comment

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

Thank you @sysradium!

@sysradium
Copy link
Contributor Author

@aymeric-roucher a merge? 🤔

@sysradium
Copy link
Contributor Author

@aymeric-roucher rebased

Copy link
Member
@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks.

@albertvillanova
Copy link
Member

Better than rebasing, I think it is better merging main into the PR branch because it preserves the public PR branch history.

@albertvillanova albertvillanova merged commit d35aeb9 into huggingface:main Mar 24, 2025
3 checks passed
@sysradium
Copy link
Contributor Author

@albertvillanova ok, will try doing that next time. We usually prefer rebase with fast-forward so the history is as linear as possible. But it may be different for this project :)

@sysradium sysradium deleted the reload-feature branch March 24, 2025 14:14
@albertvillanova
Copy link
Member
albertvillanova commented Mar 24, 2025

Yes, rebase is nice when you are working on your private/local branch on your machine. But once you open the PR, the branch becomes public and it is better to keep its history. Additionally, all inline review comments are properly kept in the corresponding code lines. GitHub makes a good job after a merge commit, by showing only the "new" code with respect to the main branch.
Also note that once the PR is approved, we made rebase/squash/merge of the whole PR branch, so the history in the main branch is linear.
Thanks anyway for your collaboration! 🤗

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.

[BUG] GradioUI cannot be reloaded
3 participants
0