Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,10 @@ JS = """function () {
|
|
30 |
}
|
31 |
}"""
|
32 |
|
33 |
-
#
|
|
|
|
|
|
|
34 |
try:
|
35 |
transformer = FluxTransformer2DModel.from_pretrained("sayakpaul/FLUX.1-merged", torch_dtype=torch.bfloat16)
|
36 |
if torch.cuda.is_available():
|
@@ -42,7 +45,6 @@ try:
|
|
42 |
print("CUDA is not available. Check your GPU settings.")
|
43 |
except Exception as e:
|
44 |
print(f"Failed to load the model: {e}")
|
45 |
-
pipe = None
|
46 |
|
47 |
# ์ด๋ฏธ์ง ์์ฑ ํจ์
|
48 |
@spaces.GPU(duration=120)
|
|
|
30 |
}
|
31 |
}"""
|
32 |
|
33 |
+
# Initialize `pipe` to None globally
|
34 |
+
pipe = None
|
35 |
+
|
36 |
+
# ๋ชจ๋ธ ๋ก๋ ์๋
|
37 |
try:
|
38 |
transformer = FluxTransformer2DModel.from_pretrained("sayakpaul/FLUX.1-merged", torch_dtype=torch.bfloat16)
|
39 |
if torch.cuda.is_available():
|
|
|
45 |
print("CUDA is not available. Check your GPU settings.")
|
46 |
except Exception as e:
|
47 |
print(f"Failed to load the model: {e}")
|
|
|
48 |
|
49 |
# ์ด๋ฏธ์ง ์์ฑ ํจ์
|
50 |
@spaces.GPU(duration=120)
|