Spaces:
Sleeping
Sleeping
elibrowne commited on
Commit ·
2eb4cf2
1
Parent(s): a425fa9
Adapting demo
Browse files
app.py
CHANGED
|
@@ -32,15 +32,13 @@ def save_json(score1, score2):
|
|
| 32 |
|
| 33 |
from datasets import load_dataset
|
| 34 |
qa_data = load_dataset("ebrowne/test-data", data_files = "test.json")
|
| 35 |
-
|
| 36 |
|
| 37 |
|
| 38 |
# VARIABLES: will eventually be loaded with JSON from a dataset
|
| 39 |
|
| 40 |
-
question_text = """
|
| 41 |
-
|
| 42 |
-
What is the answer to this question?"""
|
| 43 |
-
answers_text = ["A", "B", "C", "D"]
|
| 44 |
|
| 45 |
# BLOCKS: main user interface
|
| 46 |
|
|
@@ -57,7 +55,9 @@ with gr.Blocks() as user_eval:
|
|
| 57 |
with gr.Column(scale = 2) as passages:
|
| 58 |
passage_display = gr.Markdown("""
|
| 59 |
### Question
|
| 60 |
-
""" +
|
|
|
|
|
|
|
| 61 |
"""
|
| 62 |
### Relevant Passages
|
| 63 |
- Dataset 1
|
|
|
|
| 32 |
|
| 33 |
from datasets import load_dataset
|
| 34 |
qa_data = load_dataset("ebrowne/test-data", data_files = "test.json")
|
| 35 |
+
q = qa_data["train"][0] # loaded question data
|
| 36 |
|
| 37 |
|
| 38 |
# VARIABLES: will eventually be loaded with JSON from a dataset
|
| 39 |
|
| 40 |
+
question_text = q["prompt"] + " " + q["question"]
|
| 41 |
+
answers_text = [q["a"], q["b"], q["c"], q["d"]]
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# BLOCKS: main user interface
|
| 44 |
|
|
|
|
| 55 |
with gr.Column(scale = 2) as passages:
|
| 56 |
passage_display = gr.Markdown("""
|
| 57 |
### Question
|
| 58 |
+
""" + question_text +
|
| 59 |
+
"""
|
| 60 |
+
**Correct Answer: """ + q["answer"] +
|
| 61 |
"""
|
| 62 |
### Relevant Passages
|
| 63 |
- Dataset 1
|