Brasd99 commited on
Commit
76c067f
1 Parent(s): e34ec31

Beautified UI

Browse files
Files changed (1) hide show
  1. app.py +13 -21
app.py CHANGED
@@ -82,24 +82,16 @@ def find_answers(tags: str, questions: str) -> str:
82
 
83
  return format_results(results)
84
 
85
- inputs = [
86
- Textbox(label='Enter tags (each line is a separate tag). Maximum: 5.', lines=5),
87
- Textbox(label='Enter questions (each line is a separate question). Maximum 25.', lines=25)
88
- ]
89
-
90
- outputs = [
91
- Textbox(label='Answers')
92
- ]
93
-
94
- title = 'AnswerMate'
95
- description = 'The service allows you to get answers to all questions on the specified topic.'
96
-
97
- gradio_interface = gr.Interface(
98
- theme='soft',
99
- title=title,
100
- description=description,
101
- fn=find_answers,
102
- inputs=inputs,
103
- outputs=outputs)
104
-
105
- gradio_interface.launch()
 
82
 
83
  return format_results(results)
84
 
85
+ title = '<h1 style="text-align:center">AnswerMate</h1>'
86
+
87
+ with gr.Blocks(theme='soft', title='AnswerMate') as demo:
88
+ gr.HTML(title)
89
+ gr.Markdown('The service allows you to get answers to all questions on the specified topic.')
90
+ with gr.Row():
91
+ tags_input = gr.Textbox(label='Enter tags (each line is a separate tag). Maximum: 5.', lines=5)
92
+ questions_input = gr.Textbox(label='Enter questions (each line is a separate question). Maximum 25.', lines=25)
93
+ process_button = gr.Button('Find answers')
94
+ outputs = gr.Textbox(label='Output', placeholder='Output will appear here')
95
+ process_button.click(fn=find_answers, inputs=[tags_input, questions_input], outputs=outputs)
96
+
97
+ demo.launch()