freemt
commited on
Commit
·
7faa9af
1
Parent(s):
0bf7d6b
Update
Browse files
app.py
CHANGED
@@ -3,15 +3,23 @@ import subprocess as sp
|
|
3 |
from shlex import split
|
4 |
import gradio as gr
|
5 |
|
|
|
6 |
def greet(name):
|
7 |
try:
|
8 |
-
out = sp.check_output(split(name), encoding=
|
9 |
except Exception as e:
|
10 |
out = str(e)
|
11 |
# return "Hello " + name + "!!"
|
12 |
-
return f"[
|
|
|
13 |
|
14 |
-
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# iface.launch(share=True, debug=True)
|
17 |
iface.launch(debug=True)
|
|
|
3 |
from shlex import split
|
4 |
import gradio as gr
|
5 |
|
6 |
+
|
7 |
def greet(name):
|
8 |
try:
|
9 |
+
out = sp.check_output(split(name), encoding="utf8")
|
10 |
except Exception as e:
|
11 |
out = str(e)
|
12 |
# return "Hello " + name + "!!"
|
13 |
+
return f"[{out}]"
|
14 |
+
|
15 |
|
16 |
+
iface = gr.Interface(
|
17 |
+
fn=greet,
|
18 |
+
inputs="text",
|
19 |
+
outputs="text",
|
20 |
+
title="probe the system",
|
21 |
+
description="talk to the system via subprocess.check_output ",
|
22 |
+
)
|
23 |
|
24 |
# iface.launch(share=True, debug=True)
|
25 |
iface.launch(debug=True)
|