Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ model = model.merge_and_unload()
|
|
| 22 |
|
| 23 |
|
| 24 |
dataset = load_dataset("allenai/sciq")
|
| 25 |
-
random_test_samples = dataset["test"].select(random.sample(range(0, len(dataset["test"])),
|
| 26 |
|
| 27 |
examples = []
|
| 28 |
for row in random_test_samples:
|
|
@@ -67,8 +67,6 @@ answer_gr = gr.Text(
|
|
| 67 |
value="yellow"
|
| 68 |
)
|
| 69 |
|
| 70 |
-
button = gr.Button("Generate", elem_id="send-btn", visible=True)
|
| 71 |
-
|
| 72 |
context_output_gr = gr.Text(
|
| 73 |
label="Output"
|
| 74 |
)
|
|
@@ -88,15 +86,6 @@ distractor3_output_gr = gr.Text(
|
|
| 88 |
label="Output"
|
| 89 |
)
|
| 90 |
|
| 91 |
-
# button.click(
|
| 92 |
-
# predict,
|
| 93 |
-
# [
|
| 94 |
-
# support_gr,
|
| 95 |
-
# answer_gr,
|
| 96 |
-
# ],
|
| 97 |
-
# outputs=[context_output_gr, answer_output_gr, question_output_gr, distractor1_output_gr, distractor2_output_gr, distractor3_output_gr],
|
| 98 |
-
# )
|
| 99 |
-
|
| 100 |
gr.Interface(
|
| 101 |
fn=predict,
|
| 102 |
inputs=[support_gr, answer_gr],
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
dataset = load_dataset("allenai/sciq")
|
| 25 |
+
random_test_samples = dataset["test"].select(random.sample(range(0, len(dataset["test"])), 1))
|
| 26 |
|
| 27 |
examples = []
|
| 28 |
for row in random_test_samples:
|
|
|
|
| 67 |
value="yellow"
|
| 68 |
)
|
| 69 |
|
|
|
|
|
|
|
| 70 |
context_output_gr = gr.Text(
|
| 71 |
label="Output"
|
| 72 |
)
|
|
|
|
| 86 |
label="Output"
|
| 87 |
)
|
| 88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
gr.Interface(
|
| 90 |
fn=predict,
|
| 91 |
inputs=[support_gr, answer_gr],
|