ruslanmv commited on
Commit
bbfb2b3
·
verified ·
1 Parent(s): 2d443a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -1,26 +1,30 @@
1
 
2
  import gradio as gr
3
  import subprocess
 
4
  def run_command(command):
5
  try:
6
  result = subprocess.check_output(command, shell=True, text=True)
7
  return result
8
  except subprocess.CalledProcessError as e:
9
  return f"Error: {e}"
 
10
  iface = gr.Interface(
11
  fn=run_command,
12
  inputs="text",
13
  outputs="text",
14
- #live=True,
15
  title="Command Output Viewer",
16
  description="Enter a command and view its output.",
17
  examples=[
18
- ["ls"],
19
- ["pwd"],
20
- ["echo 'Hello, Gradio!'"],
21
- ["python --version"]]
 
22
  )
23
- iface.launch(server_name="0.0.0.0", server_port=7860)
 
 
24
  '''
25
  import gradio as gr
26
 
 
1
 
2
  import gradio as gr
3
  import subprocess
4
+
5
  def run_command(command):
6
  try:
7
  result = subprocess.check_output(command, shell=True, text=True)
8
  return result
9
  except subprocess.CalledProcessError as e:
10
  return f"Error: {e}"
11
+
12
  iface = gr.Interface(
13
  fn=run_command,
14
  inputs="text",
15
  outputs="text",
 
16
  title="Command Output Viewer",
17
  description="Enter a command and view its output.",
18
  examples=[
19
+ ["ls"],
20
+ ["pwd"],
21
+ ["echo 'Hello, Gradio!'"],
22
+ ["python --version"]
23
+ ]
24
  )
25
+
26
+ # Updated line with additional port binding for Milvus server
27
+ iface.launch(server_name="0.0.0.0", server_port=7860, share=True, debug=True)
28
  '''
29
  import gradio as gr
30