Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
@@ -8,6 +9,9 @@ import uuid
|
|
8 |
from typing import Tuple
|
9 |
import numpy as np
|
10 |
|
|
|
|
|
|
|
11 |
def save_image(img):
|
12 |
unique_name = str(uuid.uuid4()) + ".png"
|
13 |
img.save(unique_name)
|
@@ -19,6 +23,8 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
19 |
return seed
|
20 |
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
|
22 |
|
23 |
if not torch.cuda.is_available():
|
24 |
DESCRIPTIONz += "\n<p>⚠️Running on CPU, This may not work on CPU.</p>"
|
|
|
1 |
+
|
2 |
import spaces
|
3 |
import gradio as gr
|
4 |
import torch
|
|
|
9 |
from typing import Tuple
|
10 |
import numpy as np
|
11 |
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
def save_image(img):
|
16 |
unique_name = str(uuid.uuid4()) + ".png"
|
17 |
img.save(unique_name)
|
|
|
23 |
return seed
|
24 |
|
25 |
MAX_SEED = np.iinfo(np.int32).max
|
26 |
+
# Define DESCRIPTIONz before using it
|
27 |
+
DESCRIPTIONz = "" # Initialize as an empty string
|
28 |
|
29 |
if not torch.cuda.is_available():
|
30 |
DESCRIPTIONz += "\n<p>⚠️Running on CPU, This may not work on CPU.</p>"
|