acecalisto3 commited on
Commit
d110912
·
verified ·
1 Parent(s): 61adef1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -377,8 +377,15 @@ def signal_handler(signum, frame):
377
  sys.exit(0)
378
 
379
  if __name__ == "__main__":
380
- # Initialize ZeroGPU
381
- initialize_zero_gpu()
 
 
 
 
 
 
 
382
 
383
  # Register cleanup handlers
384
  atexit.register(cleanup)
 
377
  sys.exit(0)
378
 
379
  if __name__ == "__main__":
380
+ def initialize_zero_gpu():
381
+ """Initialize Hugging Face ZeroGPU (if available)"""
382
+ if torch.cuda.is_available():
383
+ # Install CUDA drivers and adjust library versions if necessary
384
+ # ... (refer to solutions above)
385
+ deepspeed.init_distributed()
386
+ print("ZeroGPU initialized successfully.")
387
+ else:
388
+ print("CUDA is not available. Using CPU instead.")
389
 
390
  # Register cleanup handlers
391
  atexit.register(cleanup)