acecalisto3 commited on
Commit
de4e532
·
verified ·
1 Parent(s): 4960a81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -12
app.py CHANGED
@@ -15,7 +15,7 @@ import urllib.parse
15
  import http.client
16
  import spaces
17
  import torch
18
- import deepspeed
19
 
20
  import warnings
21
  warnings.filterwarnings('ignore', category=UserWarning, module='__main__')
@@ -23,17 +23,6 @@ os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
23
 
24
 
25
  @spaces.GPU
26
- def initialize_zero_gpu():
27
- """Initialize Hugging Face ZeroGPU"""
28
- try:
29
- if torch.cuda.is_available():
30
- deepspeed.init_distributed()
31
- print("ZeroGPU initialized successfully.")
32
- else:
33
- print("CUDA is not available. Using CPU instead.")
34
- except Exception as e:
35
- print(f"Error initializing Hugging Face ZeroGPU: {str(e)}")
36
-
37
  def initialize_environment():
38
  """Initialize application environment and configurations"""
39
  directories = ['logs', 'resolutions', 'repos']
 
15
  import http.client
16
  import spaces
17
  import torch
18
+ from accelerate import Accelerator
19
 
20
  import warnings
21
  warnings.filterwarnings('ignore', category=UserWarning, module='__main__')
 
23
 
24
 
25
  @spaces.GPU
 
 
 
 
 
 
 
 
 
 
 
26
  def initialize_environment():
27
  """Initialize application environment and configurations"""
28
  directories = ['logs', 'resolutions', 'repos']