Spaces:
Runtime error
Runtime error
Ramesh-vani
commited on
Commit
·
21a10cf
1
Parent(s):
8c55bde
Update app.py
Browse files
app.py
CHANGED
@@ -164,15 +164,15 @@ def run_code(command):
|
|
164 |
|
165 |
return result
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
|
177 |
# gradio_interface2 = gradio.Interface(
|
178 |
# fn=run_command,
|
@@ -183,27 +183,27 @@ def run_code(command):
|
|
183 |
# description="This is an AI powered command REST API ",
|
184 |
# article=""
|
185 |
# )
|
186 |
-
|
187 |
# gradio_interface2.launch()
|
188 |
|
189 |
|
190 |
-
with gradio.Blocks() as demo:
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
|
202 |
|
203 |
-
|
204 |
-
|
205 |
|
206 |
-
if __name__ == "__main__":
|
207 |
-
|
208 |
|
209 |
|
|
|
164 |
|
165 |
return result
|
166 |
|
167 |
+
gradio_interface1 = gradio.Interface(
|
168 |
+
fn=run_code,
|
169 |
+
inputs="text",
|
170 |
+
outputs="text",
|
171 |
|
172 |
+
title="REST API ",
|
173 |
+
description="This is an AI powered languages API ",
|
174 |
+
article=""
|
175 |
+
)
|
176 |
|
177 |
# gradio_interface2 = gradio.Interface(
|
178 |
# fn=run_command,
|
|
|
183 |
# description="This is an AI powered command REST API ",
|
184 |
# article=""
|
185 |
# )
|
186 |
+
gradio_interface1.launch()
|
187 |
# gradio_interface2.launch()
|
188 |
|
189 |
|
190 |
+
# with gradio.Blocks() as demo:
|
191 |
+
# gradio.Markdown("run command or run code.")
|
192 |
+
# with gradio.Tab("run command"):
|
193 |
+
# command_input = gradio.Textbox()
|
194 |
+
# command_output = gradio.Textbox()
|
195 |
+
# command_button = gradio.Button("submit command")
|
196 |
+
# with gradio.Tab("run code"):
|
197 |
+
# with gradio.Row():
|
198 |
+
# code_input = gradio.Textbox()
|
199 |
+
# code_output = gradio.Textbox()
|
200 |
+
# code_button = gradio.Button("submit code@lanuage")
|
201 |
|
202 |
|
203 |
+
# command_button.click(run_command, inputs=command_input, outputs=command_output,api_name='command')
|
204 |
+
# code_button.click(run_code, inputs=code_input, outputs=code_output,api_name='code')
|
205 |
|
206 |
+
# if __name__ == "__main__":
|
207 |
+
# demo.launch()
|
208 |
|
209 |
|