Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -600,37 +600,4 @@ with gr.Blocks(css=CSS, title="Krea 2 Identity Edit") as demo:
|
|
| 600 |
)
|
| 601 |
|
| 602 |
if __name__ == "__main__":
|
| 603 |
-
demo.launch(
|
| 604 |
-
theme=gr.themes.Citrus(),
|
| 605 |
-
css=CSS,
|
| 606 |
-
show_error=False,
|
| 607 |
-
js="""
|
| 608 |
-
() => {
|
| 609 |
-
const replaceZeroGPUError = () => {
|
| 610 |
-
document.querySelectorAll("*").forEach((el) => {
|
| 611 |
-
if (
|
| 612 |
-
el.childNodes.length === 1 &&
|
| 613 |
-
el.textContent &&
|
| 614 |
-
el.textContent.includes(
|
| 615 |
-
"You have exceeded your ZeroGPU runs limit"
|
| 616 |
-
)
|
| 617 |
-
) {
|
| 618 |
-
el.textContent =
|
| 619 |
-
"GPU is temporarily unavailable. Please try again later.";
|
| 620 |
-
}
|
| 621 |
-
});
|
| 622 |
-
};
|
| 623 |
-
|
| 624 |
-
const observer = new MutationObserver(() => {
|
| 625 |
-
replaceZeroGPUError();
|
| 626 |
-
});
|
| 627 |
-
|
| 628 |
-
observer.observe(document.body, {
|
| 629 |
-
childList: true,
|
| 630 |
-
subtree: true
|
| 631 |
-
});
|
| 632 |
-
|
| 633 |
-
replaceZeroGPUError();
|
| 634 |
-
}
|
| 635 |
-
"""
|
| 636 |
-
)
|
|
|
|
| 600 |
)
|
| 601 |
|
| 602 |
if __name__ == "__main__":
|
| 603 |
+
demo.launch(theme=gr.themes.Citrus(), css=CSS, show_error=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|