SreejithSHR commited on
Commit
e7960e4
·
verified ·
1 Parent(s): 7e36f8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -35,9 +35,6 @@ def generate_response(user_message: str, cid: str, history: list = None) -> tupl
35
  def clear_chat() -> tuple:
36
  return [], [], str(uuid.uuid4())
37
 
38
- def redirect_to_url(url):
39
- return gr.Redirect(url)
40
-
41
  custom_css = """
42
  .gradio-container {
43
  max-width: 800px;
@@ -82,7 +79,7 @@ with gr.Blocks(analytics_enabled=False, css=custom_css) as demo:
82
  with gr.Column(scale=2):
83
  gr.Markdown("""
84
  **Multi lingual law Assistant**
85
- ===============
86
  Multi lingual Law assistant for Indian legal terms and corpus
87
  """)
88
  with gr.Column(scale=3):
@@ -92,13 +89,10 @@ with gr.Blocks(analytics_enabled=False, css=custom_css) as demo:
92
  user_message = gr.Textbox(lines=1, placeholder="Ask anything...", label="Input", show_label=False)
93
  submit_button = gr.Button("Submit")
94
  clear_button = gr.Button("Clear chat")
95
- go_back_button = gr.Button("Go Back")
96
- go_back_html = gr.HTML("")
97
 
98
  user_message.submit(fn=generate_response, inputs=[user_message, cid, history], outputs=[chatbot, history, cid], concurrency_limit=32)
99
  submit_button.click(fn=generate_response, inputs=[user_message, cid, history], outputs=[chatbot, history, cid], concurrency_limit=32)
100
  clear_button.click(fn=clear_chat, inputs=None, outputs=[chatbot, history, cid], concurrency_limit=32)
101
- go_back_button.click(fn=redirect_to_url, inputs=[gr.inputs.Textbox(value="https://www.example.com")], outputs=go_back_html)
102
 
103
  if __name__ == "__main__":
104
  demo.queue(api_open=False, max_size=40).launch(show_api=False)
 
35
  def clear_chat() -> tuple:
36
  return [], [], str(uuid.uuid4())
37
 
 
 
 
38
  custom_css = """
39
  .gradio-container {
40
  max-width: 800px;
 
79
  with gr.Column(scale=2):
80
  gr.Markdown("""
81
  **Multi lingual law Assistant**
82
+ ===============
83
  Multi lingual Law assistant for Indian legal terms and corpus
84
  """)
85
  with gr.Column(scale=3):
 
89
  user_message = gr.Textbox(lines=1, placeholder="Ask anything...", label="Input", show_label=False)
90
  submit_button = gr.Button("Submit")
91
  clear_button = gr.Button("Clear chat")
 
 
92
 
93
  user_message.submit(fn=generate_response, inputs=[user_message, cid, history], outputs=[chatbot, history, cid], concurrency_limit=32)
94
  submit_button.click(fn=generate_response, inputs=[user_message, cid, history], outputs=[chatbot, history, cid], concurrency_limit=32)
95
  clear_button.click(fn=clear_chat, inputs=None, outputs=[chatbot, history, cid], concurrency_limit=32)
 
96
 
97
  if __name__ == "__main__":
98
  demo.queue(api_open=False, max_size=40).launch(show_api=False)