Nowah commited on
Commit
d581231
·
1 Parent(s): 7f26d54
Files changed (1) hide show
  1. app2.py +17 -0
app2.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ import gradio as gr
4
+
5
+
6
+ def greet(name):
7
+ if name == "cpu":
8
+ cpu = os.environ.get("CPU_CORES")
9
+ memory = os.environ.get("MEMORY")
10
+ return f"CPU: {cpu} Memory: {memory}"
11
+ if name == "gpu":
12
+ return os.popen('nvidia-smi').read()
13
+
14
+
15
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
16
+ iface.launch()
17
+