Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -248,13 +248,15 @@ with gr.Blocks(css=custom_css) as demo:
|
|
248 |
top_10_cases = gr.State("")
|
249 |
|
250 |
with gr.Tab("Argument Evaluation"):
|
|
|
|
|
251 |
with gr.Row():
|
252 |
with gr.Column(scale=1):
|
253 |
top_10_btn = gr.Button("Give me the top 10 cases")
|
254 |
top_10_output = gr.Markdown(elem_classes=["scroll-box"])
|
255 |
top_10_btn.click(get_top_10_cases, outputs=top_10_output)
|
256 |
with gr.Column(scale=2):
|
257 |
-
message = gr.Textbox(label="Case to Argue")
|
258 |
system_message1 = gr.State("You are an expert Prosecutor. Give your best arguments for the case on behalf of the prosecution.")
|
259 |
system_message2 = gr.State("You are an expert Defense Attorney. Give your best arguments for the case on behalf of the Defense.")
|
260 |
max_tokens = gr.State(512)
|
@@ -286,17 +288,18 @@ with gr.Blocks(css=custom_css) as demo:
|
|
286 |
|
287 |
# Inner HTML for asking about the case outcome
|
288 |
with gr.Row():
|
289 |
-
case_question = gr.Textbox(label="Ask a Question about the Case Outcome")
|
290 |
case_answer = gr.Textbox(label="Answer", interactive=False, elem_classes=["scroll-box"])
|
291 |
ask_case_btn = gr.Button("Ask")
|
292 |
|
293 |
ask_case_btn.click(ask_about_case_outcome, inputs=[shared_history, case_question], outputs=case_answer)
|
294 |
|
295 |
with gr.Tab("PDF Management"):
|
|
|
296 |
pdf_upload = gr.File(label="Upload Case Files (PDF)", file_types=[".pdf"])
|
297 |
pdf_gallery = gr.Gallery(label="PDF Gallery")
|
298 |
pdf_view = gr.Textbox(label="PDF Content", interactive=False, elem_classes=["scroll-box"])
|
299 |
-
pdf_question = gr.Textbox(label="Ask a Question about the PDF")
|
300 |
pdf_answer = gr.Textbox(label="Answer", interactive=False, elem_classes=["scroll-box"])
|
301 |
pdf_upload_btn = gr.Button("Update PDF Gallery")
|
302 |
pdf_ask_btn = gr.Button("Ask")
|
@@ -306,6 +309,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
306 |
pdf_ask_btn.click(ask_about_pdf, inputs=[pdf_text, pdf_question], outputs=pdf_answer)
|
307 |
|
308 |
with gr.Tab("Chatbot"):
|
|
|
309 |
chatbot = gr.Chatbot(
|
310 |
[],
|
311 |
elem_id="chatbot",
|
|
|
248 |
top_10_cases = gr.State("")
|
249 |
|
250 |
with gr.Tab("Argument Evaluation"):
|
251 |
+
gr.Markdown("# Argument Evaluation", elem_classes=["gr-title"])
|
252 |
+
gr.Markdown("## Prosecutor vs. Defense Attorney", elem_classes=["gr-subtitle"])
|
253 |
with gr.Row():
|
254 |
with gr.Column(scale=1):
|
255 |
top_10_btn = gr.Button("Give me the top 10 cases")
|
256 |
top_10_output = gr.Markdown(elem_classes=["scroll-box"])
|
257 |
top_10_btn.click(get_top_10_cases, outputs=top_10_output)
|
258 |
with gr.Column(scale=2):
|
259 |
+
message = gr.Textbox(label="Enter Case Details to Argue", placeholder="Enter case details here...")
|
260 |
system_message1 = gr.State("You are an expert Prosecutor. Give your best arguments for the case on behalf of the prosecution.")
|
261 |
system_message2 = gr.State("You are an expert Defense Attorney. Give your best arguments for the case on behalf of the Defense.")
|
262 |
max_tokens = gr.State(512)
|
|
|
288 |
|
289 |
# Inner HTML for asking about the case outcome
|
290 |
with gr.Row():
|
291 |
+
case_question = gr.Textbox(label="Ask a Question about the Case Outcome", placeholder="Enter your question here...")
|
292 |
case_answer = gr.Textbox(label="Answer", interactive=False, elem_classes=["scroll-box"])
|
293 |
ask_case_btn = gr.Button("Ask")
|
294 |
|
295 |
ask_case_btn.click(ask_about_case_outcome, inputs=[shared_history, case_question], outputs=case_answer)
|
296 |
|
297 |
with gr.Tab("PDF Management"):
|
298 |
+
gr.Markdown("# PDF Management", elem_classes=["gr-title"])
|
299 |
pdf_upload = gr.File(label="Upload Case Files (PDF)", file_types=[".pdf"])
|
300 |
pdf_gallery = gr.Gallery(label="PDF Gallery")
|
301 |
pdf_view = gr.Textbox(label="PDF Content", interactive=False, elem_classes=["scroll-box"])
|
302 |
+
pdf_question = gr.Textbox(label="Ask a Question about the PDF", placeholder="Enter your question here...")
|
303 |
pdf_answer = gr.Textbox(label="Answer", interactive=False, elem_classes=["scroll-box"])
|
304 |
pdf_upload_btn = gr.Button("Update PDF Gallery")
|
305 |
pdf_ask_btn = gr.Button("Ask")
|
|
|
309 |
pdf_ask_btn.click(ask_about_pdf, inputs=[pdf_text, pdf_question], outputs=pdf_answer)
|
310 |
|
311 |
with gr.Tab("Chatbot"):
|
312 |
+
gr.Markdown("# Chatbot", elem_classes=["gr-title"])
|
313 |
chatbot = gr.Chatbot(
|
314 |
[],
|
315 |
elem_id="chatbot",
|