Spaces:
Runtime error
Runtime error
Commit
·
45c3f3a
1
Parent(s):
2164204
Fix the error of 'sample' key not found (#5)
Browse files- Fix the error of 'sample' key not found (137c815911a23a838611a269cae5870a033e1fa8)
Co-authored-by: Naoto Usuyama <[email protected]>
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def predict(prompt, steps=100, seed=42, guidance_scale=6.0):
|
|
| 14 |
#torch.cuda.empty_cache()
|
| 15 |
print(subprocess.check_output(["nvidia-smi"], stderr=subprocess.STDOUT).decode("utf8"))
|
| 16 |
generator = torch.manual_seed(seed)
|
| 17 |
-
images = ldm_pipeline([prompt], generator=generator, num_inference_steps=steps, eta=0.3, guidance_scale=guidance_scale)["
|
| 18 |
print(subprocess.check_output(["nvidia-smi"], stderr=subprocess.STDOUT).decode("utf8"))
|
| 19 |
return images[0]
|
| 20 |
|
|
|
|
| 14 |
#torch.cuda.empty_cache()
|
| 15 |
print(subprocess.check_output(["nvidia-smi"], stderr=subprocess.STDOUT).decode("utf8"))
|
| 16 |
generator = torch.manual_seed(seed)
|
| 17 |
+
images = ldm_pipeline([prompt], generator=generator, num_inference_steps=steps, eta=0.3, guidance_scale=guidance_scale)["images"]
|
| 18 |
print(subprocess.check_output(["nvidia-smi"], stderr=subprocess.STDOUT).decode("utf8"))
|
| 19 |
return images[0]
|
| 20 |
|