Spaces:
Runtime error
Runtime error
cache edit
Browse files
corpus.py
CHANGED
@@ -74,16 +74,14 @@ def body():
|
|
74 |
|
75 |
with st.spinner("Explaining sample (this might take a while)..."):
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
@st.cache()
|
80 |
def compute_table(samples):
|
|
|
81 |
sample_evaluations = bench.evaluate_samples(data, samples)
|
82 |
table = bench.show_samples_evaluation_table(sample_evaluations)
|
83 |
return table
|
84 |
|
85 |
table = compute_table(samples)
|
86 |
-
table = deepcopy(table)
|
87 |
|
88 |
st.markdown("### Averaged metrics")
|
89 |
st.dataframe(table)
|
|
|
74 |
|
75 |
with st.spinner("Explaining sample (this might take a while)..."):
|
76 |
|
77 |
+
@st.cache(allow_output_mutation=True)
|
|
|
|
|
78 |
def compute_table(samples):
|
79 |
+
data = bench.load_dataset("hatexplain")
|
80 |
sample_evaluations = bench.evaluate_samples(data, samples)
|
81 |
table = bench.show_samples_evaluation_table(sample_evaluations)
|
82 |
return table
|
83 |
|
84 |
table = compute_table(samples)
|
|
|
85 |
|
86 |
st.markdown("### Averaged metrics")
|
87 |
st.dataframe(table)
|