Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,6 +38,38 @@ FTP_USER = "ford442"
|
|
38 |
FTP_PASS = "GoogleBez12!"
|
39 |
FTP_DIR = "1ink.us/stable_diff/" # Remote directory on FTP server
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
DESCRIPTIONXX = """
|
42 |
## ⚡⚡⚡⚡ REALVISXL V5.0 BF16 (Tester A) ⚡⚡⚡⚡
|
43 |
"""
|
|
|
38 |
FTP_PASS = "GoogleBez12!"
|
39 |
FTP_DIR = "1ink.us/stable_diff/" # Remote directory on FTP server
|
40 |
|
41 |
+
|
42 |
+
|
43 |
+
import subprocess
|
44 |
+
|
45 |
+
def get_cuda_version():
|
46 |
+
"""
|
47 |
+
Gets the CUDA version using the nvidia-smi command.
|
48 |
+
|
49 |
+
Returns:
|
50 |
+
str: The CUDA version as a string (e.g., "11.4").
|
51 |
+
Returns None if nvidia-smi is not found or fails.
|
52 |
+
"""
|
53 |
+
try:
|
54 |
+
result = subprocess.run(['nvidia-smi'], capture_output=True, text=True)
|
55 |
+
output = result.stdout
|
56 |
+
# Find the line containing "CUDA Version"
|
57 |
+
for line in output.splitlines():
|
58 |
+
if "CUDA Version" in line:
|
59 |
+
# Extract the version number
|
60 |
+
return line.split(":")[-1].strip()
|
61 |
+
return None
|
62 |
+
except FileNotFoundError:
|
63 |
+
return None
|
64 |
+
|
65 |
+
cuda_version = get_cuda_version()
|
66 |
+
if cuda_version:
|
67 |
+
print(f"CUDA Version: {cuda_version}")
|
68 |
+
else:
|
69 |
+
print("CUDA not found or nvidia-smi command failed.")
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
DESCRIPTIONXX = """
|
74 |
## ⚡⚡⚡⚡ REALVISXL V5.0 BF16 (Tester A) ⚡⚡⚡⚡
|
75 |
"""
|