mgbam commited on
Commit
b551edc
·
verified ·
1 Parent(s): 19487ce

Update deployer/gradio_generator.py

Browse files
Files changed (1) hide show
  1. deployer/gradio_generator.py +3 -3
deployer/gradio_generator.py CHANGED
@@ -11,17 +11,17 @@ def robot_behavior(user_input: str):
11
  return bot.perform_action(text)
12
  return bot.perform_action("say I didn't understand that. Try again!")
13
 
14
- # Build Gradio app with proper Blocks context
15
  def launch_gradio_app(title="RoboSage App", description="Your robot, your voice."):
16
  with gr.Blocks() as demo:
17
  gr.Markdown(f"# 🤖 {title}\n\n{description}")
18
 
19
- # Define components (no trailing commas!)
20
  inp = gr.Textbox(label="Speak or Type", lines=1)
21
  out = gr.Textbox(label="Robot Response")
22
  btn = gr.Button("Send", key="send-btn")
23
 
24
- # Wire event inside the same Blocks context
25
  btn.click(fn=robot_behavior, inputs=[inp], outputs=[out])
26
 
27
  return demo
 
11
  return bot.perform_action(text)
12
  return bot.perform_action("say I didn't understand that. Try again!")
13
 
14
+ # Build Gradio app with correct Blocks context
15
  def launch_gradio_app(title="RoboSage App", description="Your robot, your voice."):
16
  with gr.Blocks() as demo:
17
  gr.Markdown(f"# 🤖 {title}\n\n{description}")
18
 
19
+ # Define components without trailing commas
20
  inp = gr.Textbox(label="Speak or Type", lines=1)
21
  out = gr.Textbox(label="Robot Response")
22
  btn = gr.Button("Send", key="send-btn")
23
 
24
+ # Wire the click event inside the same Blocks context
25
  btn.click(fn=robot_behavior, inputs=[inp], outputs=[out])
26
 
27
  return demo