LTEnjoy commited on
Commit
839714d
1 Parent(s): ad86811

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +18 -18
run.py CHANGED
@@ -16,30 +16,30 @@ from demo.modules.tmalign import build_TMalign
16
  with gr.Blocks() as demo:
17
  build_search_module()
18
  build_score_computation()
19
- build_TMalign()
20
 
21
- import gradio as gr
22
- import subprocess
23
 
24
 
25
- def run_command(cmd: str) -> str:
26
- p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
27
- stdout, stderr = p.communicate()
28
 
29
- if stdout:
30
- return f"[Output]\n{stdout.decode()}"
31
- if stderr:
32
- return f"[Error]\n{stderr.decode()}"
33
 
34
 
35
- # Build the block for command line interface
36
- gr.Markdown(f"# Input your command and click to run")
37
- with gr.Column():
38
- cmd = gr.Textbox(label="Input your command", value="echo 'Hello, World!'")
39
- btn = gr.Button(value="Run")
40
- output = gr.TextArea(label="Output", interactive=False)
41
-
42
- btn.click(run_command, inputs=[cmd], outputs=[output])
43
 
44
 
45
  if __name__ == '__main__':
 
16
  with gr.Blocks() as demo:
17
  build_search_module()
18
  build_score_computation()
19
+ # build_TMalign()
20
 
21
+ # import gradio as gr
22
+ # import subprocess
23
 
24
 
25
+ # def run_command(cmd: str) -> str:
26
+ # p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
27
+ # stdout, stderr = p.communicate()
28
 
29
+ # if stdout:
30
+ # return f"[Output]\n{stdout.decode()}"
31
+ # if stderr:
32
+ # return f"[Error]\n{stderr.decode()}"
33
 
34
 
35
+ # # Build the block for command line interface
36
+ # gr.Markdown(f"# Input your command and click to run")
37
+ # with gr.Column():
38
+ # cmd = gr.Textbox(label="Input your command", value="echo 'Hello, World!'")
39
+ # btn = gr.Button(value="Run")
40
+ # output = gr.TextArea(label="Output", interactive=False)
41
+
42
+ # btn.click(run_command, inputs=[cmd], outputs=[output])
43
 
44
 
45
  if __name__ == '__main__':