File size: 904 Bytes
d8b4321 | 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 | import gradio as gr
from core.brain import VitalisBrain
# Instantiate the brain for the UI
brain = VitalisBrain()
def trigger_train():
# Attempt to call the training method
if hasattr(brain, 'train_mode'):
return brain.train_mode()
return "Error: train_mode method not defined in VitalisBrain."
def trigger_deploy():
# Attempt to call the deployment method
if hasattr(brain, 'deploy_mode'):
return brain.deploy_mode()
return "Error: deploy_mode method not defined in VitalisBrain."
with gr.Blocks() as demo:
gr.Markdown("# Vitalis Core | Command Center")
with gr.Row():
btn_train = gr.Button("Train Engine")
btn_deploy = gr.Button("Deploy")
output = gr.Textbox(label="Status")
btn_train.click(trigger_train, outputs=output)
btn_deploy.click(trigger_deploy, outputs=output)
if __name__ == "__main__":
demo.launch()
|