Update run.py
Browse files
run.py
CHANGED
@@ -1,46 +1,60 @@
|
|
1 |
-
import sys
|
2 |
-
root_dir = __file__.rsplit("/", 1)[0]
|
3 |
-
if root_dir not in sys.path:
|
4 |
-
|
5 |
|
6 |
-
import gradio as gr
|
7 |
-
import asyncio
|
8 |
-
import os
|
9 |
|
10 |
-
from demo.modules.search import build_search_module
|
11 |
-
from demo.modules.compute_score import build_score_computation
|
12 |
-
from demo.modules.tmalign import build_TMalign
|
13 |
|
14 |
|
15 |
-
# Build demo
|
16 |
-
with gr.Blocks() as demo:
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
|
23 |
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
# btn.click(run_command, inputs=[cmd], outputs=[output])
|
43 |
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
if __name__ == '__main__':
|
46 |
# Run the demo
|
|
|
1 |
+
# import sys
|
2 |
+
# root_dir = __file__.rsplit("/", 1)[0]
|
3 |
+
# if root_dir not in sys.path:
|
4 |
+
# sys.path.append(root_dir)
|
5 |
|
6 |
+
# import gradio as gr
|
7 |
+
# import asyncio
|
8 |
+
# import os
|
9 |
|
10 |
+
# from demo.modules.search import build_search_module
|
11 |
+
# from demo.modules.compute_score import build_score_computation
|
12 |
+
# from demo.modules.tmalign import build_TMalign
|
13 |
|
14 |
|
15 |
+
# # Build demo
|
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__':
|
46 |
+
# # Run the demo
|
47 |
+
# demo.launch()
|
48 |
+
|
49 |
+
|
50 |
+
import gradio as gr
|
51 |
|
|
|
52 |
|
53 |
+
with gr.Blocks(title="ProTrek") as demo:
|
54 |
+
gr.Markdown("# We are working hard to build a new website for better retrieval service of ProTrek.\n\n"
|
55 |
+
"# Please move to http://search-protrek.com :)\n\n"
|
56 |
+
"# For any question, please email sujin@westlake.edu.cn & yuanfajie@westlake.edu.cn")
|
57 |
+
|
58 |
|
59 |
if __name__ == '__main__':
|
60 |
# Run the demo
|