Genzo1010 commited on
Commit
3b0b80c
·
verified ·
1 Parent(s): 79ee170

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -35
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
- import gradio as gr
114
-
115
- def get_nvcc_version():
116
- try:
117
- nvcc_version = subprocess.check_output(["nvcc", "--version"]).decode("utf-8")
118
- return "CUDA Version:\n" + nvcc_version
119
- except FileNotFoundError:
120
- return "nvcc not found. CUDA may not be installed or not in the system's PATH."
121
-
122
- def process_ocr(input_image):
123
- # Example OCR processing logic here
124
- result = "Processed OCR Result"
125
-
126
- # Check CUDA status and include it in the output
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