fantaxy commited on
Commit
dbdd92a
·
verified ·
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)