Spaces:
Running
on
Zero
Running
on
Zero
rafaaa2105
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -11,10 +11,10 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
11 |
hf_token = os.getenv('HF_TOKEN')
|
12 |
|
13 |
if torch.cuda.is_available():
|
14 |
-
|
15 |
torch.cuda.empty_cache()
|
16 |
else:
|
17 |
-
|
18 |
|
19 |
taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
|
20 |
pipe = pipeline = AutoPipelineForText2Image.from_pretrained("black-forest-labs/FLUX.1-dev", token=hf_token, torch_dtype=torch.bfloat16)
|
|
|
11 |
hf_token = os.getenv('HF_TOKEN')
|
12 |
|
13 |
if torch.cuda.is_available():
|
14 |
+
dtype = torch.float16
|
15 |
torch.cuda.empty_cache()
|
16 |
else:
|
17 |
+
dtype = torch.float32
|
18 |
|
19 |
taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
|
20 |
pipe = pipeline = AutoPipelineForText2Image.from_pretrained("black-forest-labs/FLUX.1-dev", token=hf_token, torch_dtype=torch.bfloat16)
|