-
Notifications
You must be signed in to change notification settings - Fork 571
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
[Feat] Add sleep_time
for Spaces
#1438
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1438 +/- ##
==========================================
+ Coverage 84.34% 84.37% +0.03%
==========================================
Files 52 52
Lines 5430 5448 +18
==========================================
+ Hits 4580 4597 +17
- Misses 850 851 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
src/huggingface_hub/_space_api.py
Outdated
# This value might change in the future. It is only used to trigger a warning if the user tries to set a different value | ||
# on a free Space. | ||
CPU_BASIC_SLEEP_TIME = 48 * 3600 # 48 hours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should always send a warning no matter the value if the user tries to configure sleep time on a free space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep actually why not, that would simplify the logic 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ngface_hub into feat-set-space-timeout
Thanks for the reviews! I'm merging this PR :) |
This PR adds a new
set_space_sleep_time
method to set a custom sleeping time for Spaces. By default, a (paid) upgraded hardware will never go to sleep while a cpu-basic goes to sleep after 48h. Only upgraded hardware can be configured.TODO:
set_space_sleep_time
request_space_hardware
(it's possible to request hardware + set timeout in a single call)sleep_time
to the returnedSpaceRuntime
data structurecc @abidlabs will be helpful for gradio-app/gradio#3809