Steven18 commited on
Commit
ed07608
·
1 Parent(s): 93fbb1c
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -654,9 +654,16 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
654
  # Launch the Gradio app
655
  if __name__ == "__main__":
656
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
657
- pipeline.cuda()
 
 
 
 
658
  try:
659
  pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
660
  except:
661
  pass
662
- demo.launch(show_error=True,show_api=True)
 
 
 
 
654
  # Launch the Gradio app
655
  if __name__ == "__main__":
656
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
657
+ if torch.cuda.is_available():
658
+ pipeline.cuda()
659
+ print("CUDA is available. Using GPU.")
660
+ else:
661
+ print("CUDA not available. Falling back to CPU.")
662
  try:
663
  pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
664
  except:
665
  pass
666
+ print(f"CUDA Available: {torch.cuda.is_available()}")
667
+ print(f"CUDA Version: {torch.version.cuda}")
668
+ print(f"Number of GPUs: {torch.cuda.device_count()}")
669
+ demo.launch(debug=True)