Spaces:
Running
on
Zero
Running
on
Zero
Doron Adler
commited on
Commit
•
c359cbc
1
Parent(s):
5ab52c6
Fixed a crash when running on CPU and a custom seed was set
Browse files
app.py
CHANGED
@@ -42,7 +42,12 @@ def inference(prompt, guidance, steps, width=512, height=512, seed=0, img=None,
|
|
42 |
if torch.cuda.is_available():
|
43 |
generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
|
44 |
else:
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
try:
|
48 |
if img is not None:
|
|
|
42 |
if torch.cuda.is_available():
|
43 |
generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
|
44 |
else:
|
45 |
+
if seed != 0:
|
46 |
+
torch.manual_seed(seed)
|
47 |
+
generator = torch.Generator()
|
48 |
+
generator.manual_seed(seed)
|
49 |
+
else:
|
50 |
+
generator = None
|
51 |
|
52 |
try:
|
53 |
if img is not None:
|