File size: 1,285 Bytes
3537dc0 7ec7132 3537dc0 7ec7132 839714d 3537dc0 839714d 3537dc0 839714d 3537dc0 839714d 3537dc0 839714d 3537dc0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 43 44 45 46 47 48 |
import sys
root_dir = __file__.rsplit("/", 1)[0]
if root_dir not in sys.path:
sys.path.append(root_dir)
import gradio as gr
import asyncio
import os
from demo.modules.search import build_search_module
from demo.modules.compute_score import build_score_computation
from demo.modules.tmalign import build_TMalign
# Build demo
with gr.Blocks() as demo:
build_search_module()
build_score_computation()
# build_TMalign()
# import gradio as gr
# import subprocess
# def run_command(cmd: str) -> str:
# p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# stdout, stderr = p.communicate()
# if stdout:
# return f"[Output]\n{stdout.decode()}"
# if stderr:
# return f"[Error]\n{stderr.decode()}"
# # Build the block for command line interface
# gr.Markdown(f"# Input your command and click to run")
# with gr.Column():
# cmd = gr.Textbox(label="Input your command", value="echo 'Hello, World!'")
# btn = gr.Button(value="Run")
# output = gr.TextArea(label="Output", interactive=False)
# btn.click(run_command, inputs=[cmd], outputs=[output])
if __name__ == '__main__':
# Run the demo
demo.launch()
|