Spaces:
Runtime error
Runtime error
Commit
·
d5f7cec
1
Parent(s):
7de0743
update
Browse files
app.py
CHANGED
|
@@ -26,6 +26,10 @@ def gradio_chat_completion(prompt, difficulty):
|
|
| 26 |
# produce table
|
| 27 |
df = pd.DataFrame(
|
| 28 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"Input": [input_["message"] for input_ in inputs],
|
| 30 |
"Prediction": predictions,
|
| 31 |
"Target": [target["response"] for target in targets],
|
|
@@ -82,9 +86,10 @@ with gr.Blocks() as demo:
|
|
| 82 |
)
|
| 83 |
accuracy_box = gr.Textbox(label="Accuracy", interactive=False)
|
| 84 |
results_table = gr.Dataframe(
|
| 85 |
-
headers=["Input", "Target", "Prediction"],
|
| 86 |
-
col_count=(
|
| 87 |
interactive=False,
|
|
|
|
| 88 |
)
|
| 89 |
|
| 90 |
btn.click(
|
|
|
|
| 26 |
# produce table
|
| 27 |
df = pd.DataFrame(
|
| 28 |
{
|
| 29 |
+
"Correct": [
|
| 30 |
+
predicted == target["response"]
|
| 31 |
+
for predicted, target in zip(predictions, targets)
|
| 32 |
+
],
|
| 33 |
"Input": [input_["message"] for input_ in inputs],
|
| 34 |
"Prediction": predictions,
|
| 35 |
"Target": [target["response"] for target in targets],
|
|
|
|
| 86 |
)
|
| 87 |
accuracy_box = gr.Textbox(label="Accuracy", interactive=False)
|
| 88 |
results_table = gr.Dataframe(
|
| 89 |
+
headers=["Correct", "Input", "Target", "Prediction"],
|
| 90 |
+
col_count=(4, "fixed"),
|
| 91 |
interactive=False,
|
| 92 |
+
wrap=True,
|
| 93 |
)
|
| 94 |
|
| 95 |
btn.click(
|