Spaces:
Running
on
Zero
Running
on
Zero
handle gpu quota
Browse files
app.py
CHANGED
@@ -997,16 +997,12 @@ def run_fn(
|
|
997 |
except gr.Error as e:
|
998 |
# I assume this is a GPU quota error
|
999 |
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
info = 'Running out of HuggingFace GPU Quota? Please try <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://ncut-pytorch.readthedocs.io/en/latest/demo/">Demo hosted at UPenn</a>'
|
1007 |
-
# gr.Info(info, duration=20)
|
1008 |
-
message = e.message + "</br></br>---</br>" + info
|
1009 |
-
raise gr.Error(message, duration=20)
|
1010 |
|
1011 |
|
1012 |
|
|
|
997 |
except gr.Error as e:
|
998 |
# I assume this is a GPU quota error
|
999 |
|
1000 |
+
info1 = 'Running out of HuggingFace GPU Quota? Please try <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://ncut-pytorch.readthedocs.io/en/latest/demo/">Demo hosted at UPenn</a></br>'
|
1001 |
+
info2 = 'Or try use the Python package that powers this app: <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://ncut-pytorch.readthedocs.io/en/latest/">ncut-pytorch</a>'
|
1002 |
+
info = info1 + info2
|
1003 |
+
|
1004 |
+
message = "HuggingFace: " + e.message + "</br></br>---------</br>" + "Developers: " + info
|
1005 |
+
raise gr.Error(message, duration=60)
|
|
|
|
|
|
|
|
|
1006 |
|
1007 |
|
1008 |
|