ruslanmv commited on
Commit
cb0e659
·
verified ·
1 Parent(s): e23686c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -4,6 +4,7 @@ from langchain.embeddings import HuggingFaceEmbeddings, HuggingFaceInstructEmbed
4
  from pymilvus import Collection, connections
5
  import json
6
  import os
 
7
  os.environ["TOKENIZERS_PARALLELISM"] = "false"
8
 
9
 
@@ -196,19 +197,19 @@ with gr.Blocks(
196
  outputs=[output_box])
197
 
198
 
199
-
200
  with gr.Tab("Command Viewer"):
201
  with gr.Row():
202
  with gr.Column(scale=10):
203
  command_cmd = gr.Textbox(label="Command", placeholder="Enter a command")
204
  with gr.Column(scale=1, min_width=BUTTON_MIN_WIDTH):
205
  btn_cmd = gr.Button("Run Command")
206
- output_cmd = gr.Textbox(label="Command Output", content="")
207
-
208
  def on_button_click():
209
  output_cmd.update(run_command(command_cmd.value))
210
 
211
- btn_cmd.click(on_button_click)
212
 
213
 
214
  if __name__ == "__main__":
 
4
  from pymilvus import Collection, connections
5
  import json
6
  import os
7
+ import subprocess
8
  os.environ["TOKENIZERS_PARALLELISM"] = "false"
9
 
10
 
 
197
  outputs=[output_box])
198
 
199
 
200
+
201
  with gr.Tab("Command Viewer"):
202
  with gr.Row():
203
  with gr.Column(scale=10):
204
  command_cmd = gr.Textbox(label="Command", placeholder="Enter a command")
205
  with gr.Column(scale=1, min_width=BUTTON_MIN_WIDTH):
206
  btn_cmd = gr.Button("Run Command")
207
+ output_cmd = gr.Textbox(label="Command Output", value="") # Use value instead of content
208
+
209
  def on_button_click():
210
  output_cmd.update(run_command(command_cmd.value))
211
 
212
+ btn_cmd.click(on_button_click)
213
 
214
 
215
  if __name__ == "__main__":