saisha09 commited on
Commit
6d068ed
·
1 Parent(s): 4af653a

added runtime/env check and api key check

Browse files
Files changed (1) hide show
  1. src/utils/runtime_selector.py +14 -0
src/utils/runtime_selector.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import platform
2
+ import GPUtil
3
+ from dotenv import load_dotenv
4
+ load_dotenv()
5
+
6
+ def detect_runtime_environment():
7
+ os_type = platform.system().lower()
8
+ gpus = GPUtil.getGPUs()
9
+ if gpus:
10
+ return "gpu"
11
+ elif os_type in ["darwin", "linux"]:
12
+ return "cpu-local"
13
+ else:
14
+ return "cloud-only"