zhiqiulin commited on
Commit
130b0bf
·
verified ·
1 Parent(s): 1f501ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -28,7 +28,6 @@
28
 
29
  import gradio as gr
30
  import spaces
31
- import torch
32
  import os
33
 
34
  # Global model variable, but do not initialize or move to CUDA here
@@ -39,6 +38,8 @@ def generate(model_name, image, text):
39
  global model_pipe
40
 
41
  # Debugging lines to trace CUDA initialization
 
 
42
  print(f"PID: {os.getpid()}")
43
  print(f"Before import: CUDA available: {torch.cuda.is_available()}")
44
 
 
28
 
29
  import gradio as gr
30
  import spaces
 
31
  import os
32
 
33
  # Global model variable, but do not initialize or move to CUDA here
 
38
  global model_pipe
39
 
40
  # Debugging lines to trace CUDA initialization
41
+ import torch
42
+
43
  print(f"PID: {os.getpid()}")
44
  print(f"Before import: CUDA available: {torch.cuda.is_available()}")
45