freemt
commited on
Commit
·
33d3a46
1
Parent(s):
a074264
Add python -V
Browse files
app.py
CHANGED
@@ -40,6 +40,15 @@ def process(command) -> Tuple[str, Optional[str]]:
|
|
40 |
|
41 |
logger.info("input: %s", command)
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
is_command = True
|
44 |
is_command = command.strip().splitlines().__len__() < 2 and len(command.strip()) < 500
|
45 |
|
@@ -136,7 +145,7 @@ iface = gr.Interface(
|
|
136 |
gr.outputs.Image("auto"),
|
137 |
],
|
138 |
examples=[
|
139 |
-
"python -m site"
|
140 |
"""python -c "import gradio; print(gradio.__version__")""",
|
141 |
"cat /proc/version",
|
142 |
"free # show free memory",
|
|
|
40 |
|
41 |
logger.info("input: %s", command)
|
42 |
|
43 |
+
try:
|
44 |
+
command = str(comamnd).strip()
|
45 |
+
except Exception as e:
|
46 |
+
_ = str(e)
|
47 |
+
return _, None
|
48 |
+
|
49 |
+
if not command:
|
50 |
+
return "gimme something to start with...", None
|
51 |
+
|
52 |
is_command = True
|
53 |
is_command = command.strip().splitlines().__len__() < 2 and len(command.strip()) < 500
|
54 |
|
|
|
145 |
gr.outputs.Image("auto"),
|
146 |
],
|
147 |
examples=[
|
148 |
+
"python -m site",
|
149 |
"""python -c "import gradio; print(gradio.__version__")""",
|
150 |
"cat /proc/version",
|
151 |
"free # show free memory",
|