fantaxy commited on
Commit
dbdd92a
โ€ข
1 Parent(s): c597ed5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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)