Spaces:
Runtime error
Runtime error
geekyrakshit
commited on
Commit
•
a93d065
1
Parent(s):
7fc5f26
update: application + dependencies
Browse files- app.py +2 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import os
|
2 |
import shutil
|
3 |
|
4 |
import gradio as gr
|
@@ -28,7 +27,7 @@ def generate_image(
|
|
28 |
seed,
|
29 |
):
|
30 |
if not (wandb_api_key is None or wandb_api_key == ""):
|
31 |
-
|
32 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
33 |
autolog(init=dict(project=wandb_project))
|
34 |
run_url = wandb.run.get_url()
|
@@ -41,6 +40,7 @@ def generate_image(
|
|
41 |
guidance_scale=guidance_scale,
|
42 |
num_inference_steps=num_inference_steps,
|
43 |
).images[0]
|
|
|
44 |
if torch.cuda.is_available():
|
45 |
torch.cuda.empty_cache()
|
46 |
shutil.rmtree("wandb")
|
|
|
|
|
1 |
import shutil
|
2 |
|
3 |
import gradio as gr
|
|
|
27 |
seed,
|
28 |
):
|
29 |
if not (wandb_api_key is None or wandb_api_key == ""):
|
30 |
+
wandb.login(key=wandb_api_key, relogin=True)
|
31 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
32 |
autolog(init=dict(project=wandb_project))
|
33 |
run_url = wandb.run.get_url()
|
|
|
40 |
guidance_scale=guidance_scale,
|
41 |
num_inference_steps=num_inference_steps,
|
42 |
).images[0]
|
43 |
+
wandb.finish()
|
44 |
if torch.cuda.is_available():
|
45 |
torch.cuda.empty_cache()
|
46 |
shutil.rmtree("wandb")
|
requirements.txt
CHANGED
@@ -5,4 +5,4 @@ accelerate
|
|
5 |
torch
|
6 |
ftfy
|
7 |
sentencepiece
|
8 |
-
wandb
|
|
|
5 |
torch
|
6 |
ftfy
|
7 |
sentencepiece
|
8 |
+
wandb
|