You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hub/spaces-zerogpu.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,29 @@ def generate(prompt):
81
81
82
82
This sets the maximum function runtime to 120 seconds. Specifying shorter durations for quicker functions will improve queue priority for Space visitors.
83
83
84
+
### Dynamic duration
85
+
86
+
`@spaces.GPU` also supports dynamic durations.
87
+
88
+
Instead of directly passing a duration, simply pass a callable that takes the same inputs as your decorated function and returns a duration:
0 commit comments