Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,11 +16,12 @@ def load_data(min_score=0.4, exclude_stories=True):
|
|
16 |
ds = ds.filter(lambda x: "story" not in x["format"])
|
17 |
return ds
|
18 |
|
19 |
-
|
20 |
-
min_value = st.slider('Select minimum selfcheck score', 0.0, 1.0, 0.1, key='min_score')
|
21 |
exclude_stories = st.checkbox("Exclude stories", False)
|
|
|
|
|
|
|
22 |
ds = load_data(min_score=min_value, exclude_stories=exclude_stories)
|
23 |
-
index = st.number_input(f'Found {len(ds)} samples, choose one', min_value=0, max_value=len(ds)-1, value=0, step=1)
|
24 |
|
25 |
# Load data based on slider values and checkbox status
|
26 |
sample = ds[index]
|
|
|
16 |
ds = ds.filter(lambda x: "story" not in x["format"])
|
17 |
return ds
|
18 |
|
|
|
|
|
19 |
exclude_stories = st.checkbox("Exclude stories", False)
|
20 |
+
maximum_score = 1.0 if not exclude_stories else 0.7
|
21 |
+
min_value = st.slider('Select minimum selfcheck score', 0.0, maximum_score, 0.1, key='min_score')
|
22 |
+
|
23 |
ds = load_data(min_score=min_value, exclude_stories=exclude_stories)
|
24 |
+
index = st.number_input(f'Found {len(ds)} samples, choose one (max score is {max(ds['passage_score'])}', min_value=0, max_value=len(ds)-1, value=0, step=1)
|
25 |
|
26 |
# Load data based on slider values and checkbox status
|
27 |
sample = ds[index]
|