Spaces:
Sleeping
Sleeping
example question
Browse files
app.py
CHANGED
@@ -15,7 +15,8 @@ def get_answer(context, question):
|
|
15 |
|
16 |
|
17 |
examples = [
|
18 |
-
["""In supervised learning, input data is provided to the model along with the output. In unsupervised learning, only input data is provided to the model. The goal of supervised learning is to train the model so that it can predict the output when it is given new data.""",
|
|
|
19 |
# [] # You can add context examples without questions
|
20 |
]
|
21 |
|
@@ -24,11 +25,13 @@ demo = gr.Blocks()
|
|
24 |
|
25 |
with demo:
|
26 |
with gr.Row():
|
27 |
-
context = gr.Textbox(label='Document', lines=10)
|
28 |
-
question = gr.Textbox(label='Question', lines= 3)
|
29 |
-
b1 = gr.Button('Get Answer')
|
30 |
answer = gr.Textbox(label='Answer', lines=4)
|
31 |
-
gr.
|
|
|
|
|
|
|
32 |
b1.click(fn = get_answer, inputs=[context, question], outputs=answer)
|
33 |
|
34 |
demo.launch()
|
|
|
15 |
|
16 |
|
17 |
examples = [
|
18 |
+
["""In supervised learning, input data is provided to the model along with the output. In unsupervised learning, only input data is provided to the model. The goal of supervised learning is to train the model so that it can predict the output when it is given new data.""",
|
19 |
+
"In what learning only data is provided",],
|
20 |
# [] # You can add context examples without questions
|
21 |
]
|
22 |
|
|
|
25 |
|
26 |
with demo:
|
27 |
with gr.Row():
|
28 |
+
context = gr.Textbox(label='Document', lines=10, scale=2)
|
29 |
+
question = gr.Textbox(label='Question', lines= 3,scale=1)
|
|
|
30 |
answer = gr.Textbox(label='Answer', lines=4)
|
31 |
+
b1 = gr.Button('Get Answer', size='sm', scale=0.5)
|
32 |
+
gr.Examples(examples=examples, inputs=[context, question], outputs=answer)
|
33 |
+
# with gr.Column():
|
34 |
+
# gr.Markdown('A example input on the left')
|
35 |
b1.click(fn = get_answer, inputs=[context, question], outputs=answer)
|
36 |
|
37 |
demo.launch()
|