productizationlabs
commited on
Commit
·
f1921e4
1
Parent(s):
8b0ee3a
Upload app.py
Browse files
app.py
CHANGED
@@ -20,14 +20,14 @@ def predict_chatgpt(inputs,chat_counter_chatgpt,chatbot_chatgpt=[],history=[]):
|
|
20 |
R=[(A[B],A[B+1])for B in range(0,len(A)-1,2)];L+=1;yield(R,A,D)
|
21 |
def reset_textbox():return gr.update(value='')
|
22 |
def reset_chat(chatbot,state):return None,[]
|
23 |
-
with gr.Blocks(css='#col_container {width: 1000px; margin-left: auto; margin-right: auto;}\n #chatgpt {height: 400px; overflow: auto;}} ',theme=gr.themes.Default(primary_hue='slate'))as
|
24 |
with gr.Row():
|
25 |
with gr.Column(scale=14):
|
26 |
with gr.Box():
|
27 |
with gr.Row():
|
28 |
-
with gr.Column(scale=13):inputs=gr.Textbox(label='Ask
|
29 |
with gr.Column(scale=1):b1=gr.Button('Submit',elem_id='submit').style(full_width=True);b2=gr.Button('Clear',elem_id='clear').style(full_width=True)
|
30 |
state_chatgpt=gr.State([])
|
31 |
with gr.Box():
|
32 |
-
with gr.Row():chatbot_chatgpt=gr.Chatbot(elem_id='chatgpt',label='
|
33 |
-
chat_counter_chatgpt=gr.Number(value=0,visible=False,precision=0);inputs.submit(reset_textbox,[],[inputs]);b1.click(predict_chatgpt,[inputs,chat_counter_chatgpt,chatbot_chatgpt,state_chatgpt],[chatbot_chatgpt,state_chatgpt]);b2.click(reset_chat,[chatbot_chatgpt,state_chatgpt],[chatbot_chatgpt,state_chatgpt]);
|
|
|
20 |
R=[(A[B],A[B+1])for B in range(0,len(A)-1,2)];L+=1;yield(R,A,D)
|
21 |
def reset_textbox():return gr.update(value='')
|
22 |
def reset_chat(chatbot,state):return None,[]
|
23 |
+
with gr.Blocks(css='#col_container {width: 1000px; margin-left: auto; margin-right: auto;}\n #chatgpt {height: 400px; overflow: auto;}} ',theme=gr.themes.Default(primary_hue='slate'))as LegalProdigy:
|
24 |
with gr.Row():
|
25 |
with gr.Column(scale=14):
|
26 |
with gr.Box():
|
27 |
with gr.Row():
|
28 |
+
with gr.Column(scale=13):inputs=gr.Textbox(label='Ask any legal query ⤵️ Try : Explain arbitration process')
|
29 |
with gr.Column(scale=1):b1=gr.Button('Submit',elem_id='submit').style(full_width=True);b2=gr.Button('Clear',elem_id='clear').style(full_width=True)
|
30 |
state_chatgpt=gr.State([])
|
31 |
with gr.Box():
|
32 |
+
with gr.Row():chatbot_chatgpt=gr.Chatbot(elem_id='chatgpt',label='Conversational AI for Legal')
|
33 |
+
chat_counter_chatgpt=gr.Number(value=0,visible=False,precision=0);inputs.submit(reset_textbox,[],[inputs]);b1.click(predict_chatgpt,[inputs,chat_counter_chatgpt,chatbot_chatgpt,state_chatgpt],[chatbot_chatgpt,state_chatgpt]);b2.click(reset_chat,[chatbot_chatgpt,state_chatgpt],[chatbot_chatgpt,state_chatgpt]);LegalProdigy.queue(concurrency_count=16).launch(height=2500,debug=True)
|