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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -51,19 +51,18 @@ with gr.Blocks() as demo:
51
  <h1 style="text-align: center;">Legal Document Drafting</h1>
52
  """)
53
  with gr.Tab("Writing Assist"):
54
- # with gr.Column():
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.Column():
62
  with gr.Tab("Random Generative"):
63
- result2 = gr.components.Textbox(lines=7, label="Random Generative", show_label=True, placeholder=prompts[1])
64
- gr.Examples(examples, label='Examples', inputs=[result2])
65
- rnd_btn = gr.Button("Random Drafting")
66
- rnd_btn.click(rnd_generate, inputs=[result2], outputs=[result2])
 
67
 
68
  if __name__ == "__main__":
69
  demo.launch()
 
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()