Spaces:
Runtime error
Runtime error
updt
Browse files
app.py
CHANGED
@@ -5,7 +5,8 @@ import torch as th
|
|
5 |
from torch import autocast
|
6 |
from diffusers import StableDiffusionPipeline
|
7 |
|
8 |
-
HF_TOKEN = os.environ
|
|
|
9 |
has_cuda = th.cuda.is_available()
|
10 |
device = th.device('cpu' if not th.cuda.is_available() else 'cuda')
|
11 |
print(f"device is :{device}")
|
@@ -24,7 +25,7 @@ def get_sd(translated_txt):
|
|
24 |
|
25 |
#API_URL = "https://api-inference.huggingface.co/models/bigscience/bloom"
|
26 |
#HF_TOKEN = os.environ.get("diffuse_new") or True
|
27 |
-
|
28 |
#headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
29 |
sd_inf = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion", use_auth_token=HF_TOKEN )#'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')
|
30 |
|
|
|
5 |
from torch import autocast
|
6 |
from diffusers import StableDiffusionPipeline
|
7 |
|
8 |
+
HF_TOKEN = os.environ["HF_TOKEN"]
|
9 |
+
#HF_TOKEN = os.environ.get("diffuse_new") or True
|
10 |
has_cuda = th.cuda.is_available()
|
11 |
device = th.device('cpu' if not th.cuda.is_available() else 'cuda')
|
12 |
print(f"device is :{device}")
|
|
|
25 |
|
26 |
#API_URL = "https://api-inference.huggingface.co/models/bigscience/bloom"
|
27 |
#HF_TOKEN = os.environ.get("diffuse_new") or True
|
28 |
+
|
29 |
#headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
30 |
sd_inf = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion", use_auth_token=HF_TOKEN )#'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')
|
31 |
|