beowcow commited on
Commit
6f50bfa
·
verified ·
1 Parent(s): cd07287

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -106,8 +106,8 @@ import math
106
  IN_HF_SPACE = os.environ.get('SPACE_ID') is not None
107
 
108
  # 添加变量跟踪GPU可用性
109
- GPU_AVAILABLE = False
110
- GPU_INITIALIZED = False
111
  last_update_time = time.time()
112
 
113
  # 如果在Hugging Face Space中,导入spaces模块
@@ -132,7 +132,7 @@ if IN_HF_SPACE:
132
  else:
133
  print("警告: CUDA报告可用,但未检测到GPU设备")
134
  except Exception as e:
135
- GPU_AVAILABLE = False
136
  print(f"检查GPU时出错: {e}")
137
  print("将使用CPU模式运行")
138
  except ImportError:
 
106
  IN_HF_SPACE = os.environ.get('SPACE_ID') is not None
107
 
108
  # 添加变量跟踪GPU可用性
109
+ GPU_AVAILABLE = True
110
+ GPU_INITIALIZED = True
111
  last_update_time = time.time()
112
 
113
  # 如果在Hugging Face Space中,导入spaces模块
 
132
  else:
133
  print("警告: CUDA报告可用,但未检测到GPU设备")
134
  except Exception as e:
135
+ GPU_AVAILABLE = True
136
  print(f"检查GPU时出错: {e}")
137
  print("将使用CPU模式运行")
138
  except ImportError: