Spaces:
Runtime error
Runtime error
Ramesh-vani
commited on
Commit
·
face11b
1
Parent(s):
4bb4d01
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio
|
2 |
import subprocess
|
3 |
-
from gradio.mix import Parallel
|
4 |
|
5 |
def run_command(command):
|
6 |
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
@@ -153,33 +153,28 @@ def run_code(command):
|
|
153 |
|
154 |
return result
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
# gradio_interface1.launch()
|
176 |
# gradio_interface2.launch()
|
|
|
177 |
|
178 |
-
iface = gradio.Interface(
|
179 |
-
fn=Parallel(run_code, run_command), # List of functions for each API
|
180 |
-
inputs=["text", "text"], # List of input types for each API
|
181 |
-
outputs=["text", "text"] # List of output types for each API
|
182 |
-
)
|
183 |
|
184 |
-
iface.launch()
|
185 |
|
|
|
1 |
import gradio
|
2 |
import subprocess
|
3 |
+
from gradio.mix import Parallel,Series
|
4 |
|
5 |
def run_command(command):
|
6 |
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
153 |
|
154 |
return result
|
155 |
|
156 |
+
gradio_interface1 = gradio.Interface(
|
157 |
+
fn=run_code,
|
158 |
+
inputs="text",
|
159 |
+
outputs="text",
|
160 |
|
161 |
+
title="REST API ",
|
162 |
+
description="This is an AI powered languages API ",
|
163 |
+
article=""
|
164 |
+
)
|
165 |
|
166 |
+
gradio_interface2 = gradio.Interface(
|
167 |
+
fn=run_command,
|
168 |
+
inputs="text",
|
169 |
+
outputs="text",
|
170 |
|
171 |
+
title="REST API ",
|
172 |
+
description="This is an AI powered command REST API ",
|
173 |
+
article=""
|
174 |
+
)
|
175 |
# gradio_interface1.launch()
|
176 |
# gradio_interface2.launch()
|
177 |
+
Parallel(gradio_interface1,gradio_interface2).launch()
|
178 |
|
|
|
|
|
|
|
|
|
|
|
179 |
|
|
|
180 |
|