jslin09 commited on
Commit
66d638a
·
1 Parent(s): 8d464bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -50,19 +50,21 @@ with gr.Blocks() as demo:
50
  """
51
  <h1 style="text-align: center;">Legal Document Drafting</h1>
52
  """)
53
- with gr.Tab("Writing Assist"):
54
- result = gr.components.Textbox(lines=7, label="Writing Assist", placeholder=prompts[0])
55
- prompt = gr.components.Textbox(lines=2, label="Prompt", placeholder=examples[0], visible=False)
56
- gr.Examples(examples, label='Examples', inputs=[prompt])
57
- prompt.change(generate, inputs=[prompt], outputs=[result])
58
- btn = gr.Button("Next sentence")
59
- btn.click(generate, inputs=[result], outputs=[result])
60
- with gr.Tab("Random Generative"):
61
- result2 = gr.components.Textbox(lines=7, label="Random Generative", show_label=True, placeholder=prompts[1])
62
- gr.Examples(examples, label='Examples', inputs=[result2])
63
- rnd_btn = gr.Button("Random Drafting")
64
- rnd_btn.click(rnd_generate, inputs=[result2], outputs=[result2])
65
- gr.Markdown("Legal Document drafting demo")
 
 
66
 
67
  if __name__ == "__main__":
68
  demo.launch()
 
50
  """
51
  <h1 style="text-align: center;">Legal Document Drafting</h1>
52
  """)
53
+ with gr.Column():
54
+ with gr.Tab("Writing Assist"):
55
+ result = gr.components.Textbox(lines=7, label="Writing Assist", placeholder=prompts[0])
56
+ prompt = gr.components.Textbox(lines=2, label="Prompt", placeholder=examples[0], visible=False)
57
+ gr.Examples(examples, label='Examples', inputs=[prompt])
58
+ prompt.change(generate, inputs=[prompt], outputs=[result])
59
+ btn = gr.Button("Next sentence")
60
+ btn.click(generate, inputs=[result], outputs=[result])
61
+ with gr.Tab("Random Generative"):
62
+ result2 = gr.components.Textbox(lines=7, label="Random Generative", show_label=True, placeholder=prompts[1])
63
+ gr.Examples(examples, label='Examples', inputs=[result2])
64
+ rnd_btn = gr.Button("Random Drafting")
65
+ rnd_btn.click(rnd_generate, inputs=[result2], outputs=[result2])
66
+ with gr.Column():
67
+ gr.Markdown("Legal Document drafting demo")
68
 
69
  if __name__ == "__main__":
70
  demo.launch()