Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -100,42 +100,21 @@
|
|
100 |
|
101 |
# demo.launch(share=True)
|
102 |
|
103 |
-
|
104 |
-
# import paddle
|
105 |
-
# print("PaddlePaddle Version:", paddle.__version__)
|
106 |
-
# print("Is GPU available:", paddle.is_compiled_with_cuda())
|
107 |
-
# import tensorflow as tf
|
108 |
-
# print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
|
109 |
-
# import tensorflow as tf
|
110 |
-
# print("Where tensorflow is built with cuda:",tf.test.is_built_with_cuda())
|
111 |
-
|
112 |
import subprocess
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
cuda_status = get_nvcc_version()
|
128 |
-
return f"{result}\n\n{cuda_status}"
|
129 |
-
|
130 |
-
iface = gr.Interface(
|
131 |
-
fn=process_ocr,
|
132 |
-
inputs="image",
|
133 |
-
outputs="text",
|
134 |
-
title="OCR App with CUDA Check",
|
135 |
-
description="This app checks if CUDA is available and processes OCR."
|
136 |
-
)
|
137 |
-
|
138 |
-
iface.launch()
|
139 |
|
140 |
|
141 |
|
|
|
100 |
|
101 |
# demo.launch(share=True)
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
import subprocess
|
104 |
+
|
105 |
+
try:
|
106 |
+
nvcc_version = subprocess.check_output(["nvcc", "--version"]).decode("utf-8")
|
107 |
+
print("CUDA Version:", nvcc_version)
|
108 |
+
except FileNotFoundError:
|
109 |
+
print("nvcc not found. CUDA may not be installed or not in the system's PATH.")
|
110 |
+
|
111 |
+
import paddle
|
112 |
+
print("PaddlePaddle Version:", paddle.__version__)
|
113 |
+
print("Is GPU available:", paddle.is_compiled_with_cuda())
|
114 |
+
import tensorflow as tf
|
115 |
+
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
|
116 |
+
import tensorflow as tf
|
117 |
+
print("Where tensorflow is built with cuda:",tf.test.is_built_with_cuda())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
|
120 |
|