llm_eval_system / tabs /shell_tab.py
HoneyTian's picture
first commit
4464055
raw
history blame contribute delete
547 Bytes
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import gradio as gr
from toolbox.os.command import Command
def shell(cmd: str):
return Command.popen(cmd)
def get_shell_tab():
with gr.TabItem("shell"):
shell_text = gr.Textbox(label="cmd")
shell_button = gr.Button("run")
shell_output = gr.Textbox(label="output", max_lines=100)
shell_button.click(
shell,
inputs=[shell_text, ],
outputs=[shell_output],
)
return locals()
if __name__ == "__main__":
pass