jackculpan commited on
Commit
b251756
·
1 Parent(s): b8c7519
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -46,6 +46,8 @@ def chatbot(input):
46
 
47
 
48
  with gr.Blocks(css="footer {visibility: hidden}", title="chatWEBPAGE") as demo:
 
 
49
  url = gr.Textbox(label="1. Enter a webpage URL to chat about")
50
  url.change(fn=get_data, inputs=url)
51
  gr.Examples(["https://www.nerdwallet.com/article/travel/how-much-are-my-united-miles-worth",
@@ -71,23 +73,24 @@ with gr.Blocks(css="footer {visibility: hidden}", title="chatWEBPAGE") as demo:
71
  history[-1][1] = bot_message
72
  return history
73
 
74
- msg.submit(user, [msg, chatbot_item], [msg, chatbot_item], queue=False).then(
75
  bot, chatbot_item, chatbot_item
76
  )
77
 
78
- submit_button.click(user, [msg, chatbot_item], [msg, chatbot_item], queue=False).then(
79
  bot, chatbot_item, chatbot_item
80
  )
81
 
82
  clear_button.click(lambda: None, None, chatbot_item, queue=False)
83
-
 
 
84
  # msg.submit(user, [msg, chatbot_item], [msg, chatbot_item], queue=False)
85
  # submit_button.click(user, [msg, chatbot_item], [msg, chatbot_item], queue=False)
86
  # clear_button.click(bot, chatbot_item, chatbot_item, queue=False)
87
 
88
 
89
  # if __name__ == "__main__":
90
- demo.launch()
91
 
92
  # with gr.Row():
93
  # with gr.Column(scale=2):
 
46
 
47
 
48
  with gr.Blocks(css="footer {visibility: hidden}", title="chatWEBPAGE") as demo:
49
+ gr.Markdown("Enter your website url, then ask the AI a question.")
50
+
51
  url = gr.Textbox(label="1. Enter a webpage URL to chat about")
52
  url.change(fn=get_data, inputs=url)
53
  gr.Examples(["https://www.nerdwallet.com/article/travel/how-much-are-my-united-miles-worth",
 
73
  history[-1][1] = bot_message
74
  return history
75
 
76
+ msg.submit(user, [msg, chatbot_item], [msg, chatbot_item], queue=False).success(
77
  bot, chatbot_item, chatbot_item
78
  )
79
 
80
+ submit_button.click(user, [msg, chatbot_item], [msg, chatbot_item], queue=False).success(
81
  bot, chatbot_item, chatbot_item
82
  )
83
 
84
  clear_button.click(lambda: None, None, chatbot_item, queue=False)
85
+ if __name__ == "__main__":
86
+ demo.launch()
87
+
88
  # msg.submit(user, [msg, chatbot_item], [msg, chatbot_item], queue=False)
89
  # submit_button.click(user, [msg, chatbot_item], [msg, chatbot_item], queue=False)
90
  # clear_button.click(bot, chatbot_item, chatbot_item, queue=False)
91
 
92
 
93
  # if __name__ == "__main__":
 
94
 
95
  # with gr.Row():
96
  # with gr.Column(scale=2):