Skip to content

Auto-deploy to Spaces#27

Merged
znation merged 12 commits into
gradio-app:mainfrom
znation:zn/pr-deploy-to-space
May 21, 2025
Merged

Auto-deploy to Spaces#27
znation merged 12 commits into
gradio-app:mainfrom
znation:zn/pr-deploy-to-space

Conversation

@znation
Copy link
Copy Markdown
Collaborator

@znation znation commented May 20, 2025

  • Add a space_id param to trackio.init, which will use an existing trackio space or deploy one on demand if it does not yet exist.
  • Fix imports in ui.py and its relative dependencies to work both within and outside of a package/module. Gradio loads its app file outside of a module context.
  • Add a README.md to trackio to default to the correct app file when uploading to a new Space.

TODO / not yet tested:

  • Block metrics from non-authenticated clients (I think it is currently wide open and always deploys on a public space)
  • Better UX for specifying HF_TOKEN when not specified

* Add a space_id param to trackio.init, which will use an existing
  trackio space or deploy one on demand if it does not yet exist.
* Fix imports in ui.py and its relative dependencies to work both within
  and outside of a package/module. Gradio loads its app file outside of
  a module context.
* Add a README.md to trackio to default to the correct app file when
  uploading to a new Space.

TODO / not yet tested:

* Block metrics from non-authenticated clients (I think it is currently
  wide open and always deploys on a public space)
* Better UX for specifying HF_TOKEN when not specified
@znation znation requested review from Saba9 and abidlabs May 20, 2025 08:38
@znation
Copy link
Copy Markdown
Collaborator Author

znation commented May 20, 2025

@abidlabs if this looks good to you please approve and I'll merge. Thanks!

@abidlabs
Copy link
Copy Markdown
Member

Sorry @znation for the delay, will review this tom!

@znation
Copy link
Copy Markdown
Collaborator Author

znation commented May 21, 2025

@abidlabs oh, no worries, I am not blocked so please take your time.

Comment thread trackio/README.md Outdated
@@ -0,0 +1,5 @@
---
sdk: gradio
sdk_version: 5.30.0
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.

I think it'd be better to get the user's gr.__version__ and use that here to ensure a consistent experience locally and on Spaces.

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.

updated

@abidlabs
Copy link
Copy Markdown
Member

Works great @znation! #27

image

Let me just add some validation logic & then we should be good to merge in

Copy link
Copy Markdown
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

LGTM good stuff @znation! You may want to add a section in the trackio github repo README.md with this stuff!

@znation
Copy link
Copy Markdown
Collaborator Author

znation commented May 21, 2025

Thanks @abidlabs, I will add a README section and then merge.

@znation znation merged commit aa533d0 into gradio-app:main May 21, 2025
2 checks passed
@znation znation deleted the zn/pr-deploy-to-space branch May 21, 2025 22:15
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.

2 participants