File size: 459 Bytes
c015fd4
 
 
c33b262
 
 
c015fd4
 
 
 
 
 
 
c33b262
 
c015fd4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# import httpx
import subprocess as sp
from shlex import split
import gradio as gr

def greet(name):
    try:
        # out = subprocess.check_output(["nvidia-smi", "-L"], encoding='utf8')
        out = sp.check_output(split(name), encoding='utf8')
    except Exception as e:
        out = str(e)
    # return "Hello " + name + "!!"
    return f"[out: {out}]"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch(share=True, debug=True)