Spaces:
Running
on
Zero
Running
on
Zero
Update spaces/zero/client.py
Browse files- spaces/zero/client.py +6 -4
spaces/zero/client.py
CHANGED
@@ -140,16 +140,18 @@ def schedule(
|
|
140 |
raise error("ZeroGPU quota exceeded", message)
|
141 |
else:
|
142 |
if payload.get('user') is None and res.wait == 0:
|
143 |
-
|
|
|
144 |
else:
|
145 |
gpu = "Pro GPU" if auth == 'pro' else ("free GPU" if auth == 'regular' else "GPU")
|
146 |
-
|
147 |
f"You have exceeded your {gpu} quota "
|
148 |
f"({requested}s requested vs. {res.left}s left). "
|
149 |
f"Try again in {res.wait}"
|
150 |
)
|
151 |
-
|
152 |
-
|
|
|
153 |
|
154 |
if not isinstance(res, httpx.codes): # pragma: no cover
|
155 |
if meta.queuing_reason in ('node', None):
|
|
|
140 |
raise error("ZeroGPU quota exceeded", message)
|
141 |
else:
|
142 |
if payload.get('user') is None and res.wait == 0:
|
143 |
+
message_html = "You have exceeded your runs limit."
|
144 |
+
message_text = "You have exceeded your runs limit. Please login or create an account on https://huggingface.co/join"
|
145 |
else:
|
146 |
gpu = "Pro GPU" if auth == 'pro' else ("free GPU" if auth == 'regular' else "GPU")
|
147 |
+
message_html = (
|
148 |
f"You have exceeded your {gpu} quota "
|
149 |
f"({requested}s requested vs. {res.left}s left). "
|
150 |
f"Try again in {res.wait}"
|
151 |
)
|
152 |
+
message_text = "You are currently out of ZeroGPU quotas. To get more, please visit https://huggingface.co/subscribe/pro"
|
153 |
+
message = html_string(message_html, message_text)
|
154 |
+
raise error("ZeroGPU quota exceeded", message, html=True)
|
155 |
|
156 |
if not isinstance(res, httpx.codes): # pragma: no cover
|
157 |
if meta.queuing_reason in ('node', None):
|