ruslanmv commited on
Commit
20a74af
·
1 Parent(s): 3ed0d1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -20,7 +20,7 @@ import shutil
20
  import numpy as np
21
  import random
22
  from diffusers import DiffusionPipeline
23
-
24
  # Initialize FLUX pipeline outside of the function
25
  dtype = torch.bfloat16
26
  device = "cuda" if torch.cuda.is_available() else "cpu"
@@ -34,15 +34,15 @@ nltk.download('punkt')
34
  multiprocessing.set_start_method("spawn", force=True)
35
 
36
  # GPU Fallback Setup
37
- if os.environ.get("SPACES_ZERO_GPU") is not None:
38
- import spaces
39
- else:
40
- class spaces:
41
- @staticmethod
42
- def GPU(func=None, duration=None):
43
- def wrapper(fn):
44
- return fn
45
- return wrapper if func is None else wrapper(func)
46
 
47
  # Download necessary NLTK data
48
  def setup_nltk():
 
20
  import numpy as np
21
  import random
22
  from diffusers import DiffusionPipeline
23
+ import spaces
24
  # Initialize FLUX pipeline outside of the function
25
  dtype = torch.bfloat16
26
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
34
  multiprocessing.set_start_method("spawn", force=True)
35
 
36
  # GPU Fallback Setup
37
+ #if os.environ.get("SPACES_ZERO_GPU") is not None:
38
+ # import spaces
39
+ #else:
40
+ # class spaces:
41
+ # @staticmethod
42
+ # def GPU(func=None, duration=None):
43
+ ## def wrapper(fn):
44
+ # return fn
45
+ # return wrapper if func is None else wrapper(func)
46
 
47
  # Download necessary NLTK data
48
  def setup_nltk():