Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,8 @@ import os
|
|
2 |
import json
|
3 |
import requests
|
4 |
|
|
|
|
|
5 |
import gradio as gr
|
6 |
import pandas as pd
|
7 |
from huggingface_hub import HfApi, hf_hub_download, snapshot_download
|
@@ -266,10 +268,12 @@ def filter_data(rl_env, task_id, selected_values, path):
|
|
266 |
Filters the data based on the selected difficulty/pattern values.
|
267 |
"""
|
268 |
data = get_data(rl_env, task_id, path)
|
269 |
-
|
270 |
# If there are selected values, filter the DataFrame
|
271 |
if selected_values:
|
272 |
filter_column = "Pattern" if "Pattern" in data.columns else "Difficulty"
|
|
|
|
|
273 |
data = data[data[filter_column].isin(selected_values)]
|
274 |
|
275 |
return data
|
|
|
2 |
import json
|
3 |
import requests
|
4 |
|
5 |
+
import numpy as np
|
6 |
+
|
7 |
import gradio as gr
|
8 |
import pandas as pd
|
9 |
from huggingface_hub import HfApi, hf_hub_download, snapshot_download
|
|
|
268 |
Filters the data based on the selected difficulty/pattern values.
|
269 |
"""
|
270 |
data = get_data(rl_env, task_id, path)
|
271 |
+
|
272 |
# If there are selected values, filter the DataFrame
|
273 |
if selected_values:
|
274 |
filter_column = "Pattern" if "Pattern" in data.columns else "Difficulty"
|
275 |
+
if filter_column == "Difficulty":
|
276 |
+
selected_values = [np.int64(sv) for sv in selected_values]
|
277 |
data = data[data[filter_column].isin(selected_values)]
|
278 |
|
279 |
return data
|