albertvillanova HF staff commited on
Commit
460930f
1 Parent(s): 841e241

Fix fs variable

Browse files
Files changed (3) hide show
  1. app.py +0 -3
  2. src/details.py +2 -1
  3. src/results.py +4 -1
app.py CHANGED
@@ -1,5 +1,4 @@
1
  import gradio as gr
2
- from huggingface_hub import HfFileSystem
3
 
4
  from src.constants import SUBTASKS, TASKS
5
  from src.details import update_subtasks_component, update_load_details_component, load_details_dataframes, \
@@ -8,8 +7,6 @@ from src.results import fetch_result_paths, filter_latest_result_path_per_model,
8
  load_results_dataframes, display_results, update_tasks_component, clear_results
9
 
10
 
11
- fs = HfFileSystem()
12
-
13
 
14
  # if __name__ == "__main__":
15
  latest_result_path_per_model = filter_latest_result_path_per_model(fetch_result_paths())
 
1
  import gradio as gr
 
2
 
3
  from src.constants import SUBTASKS, TASKS
4
  from src.details import update_subtasks_component, update_load_details_component, load_details_dataframes, \
 
7
  load_results_dataframes, display_results, update_tasks_component, clear_results
8
 
9
 
 
 
10
 
11
  # if __name__ == "__main__":
12
  latest_result_path_per_model = filter_latest_result_path_per_model(fetch_result_paths())
src/details.py CHANGED
@@ -2,8 +2,8 @@ import json
2
 
3
  import gradio as gr
4
  import pandas as pd
 
5
 
6
- from app import fs
7
  from src.constants import SUBTASKS, DETAILS_DATASET_ID, DETAILS_FILENAME
8
 
9
 
@@ -23,6 +23,7 @@ def update_load_details_component(model_id_1, model_id_2, subtask):
23
 
24
 
25
  def load_details_dataframe(model_id, subtask):
 
26
  if not model_id or not subtask:
27
  return
28
  model_name_sanitized = model_id.replace("/", "__")
 
2
 
3
  import gradio as gr
4
  import pandas as pd
5
+ from huggingface_hub import HfFileSystem
6
 
 
7
  from src.constants import SUBTASKS, DETAILS_DATASET_ID, DETAILS_FILENAME
8
 
9
 
 
23
 
24
 
25
  def load_details_dataframe(model_id, subtask):
26
+ fs = HfFileSystem()
27
  if not model_id or not subtask:
28
  return
29
  model_name_sanitized = model_id.replace("/", "__")
src/results.py CHANGED
@@ -2,12 +2,14 @@ import json
2
 
3
  import gradio as gr
4
  import pandas as pd
 
5
 
6
- from app import fs, latest_result_path_per_model
7
  from src.constants import RESULTS_DATASET_ID, TASKS
8
 
9
 
10
  def fetch_result_paths():
 
11
  paths = fs.glob(f"{RESULTS_DATASET_ID}/**/**/*.json")
12
  return paths
13
 
@@ -31,6 +33,7 @@ def update_load_results_component():
31
 
32
 
33
  def load_data(result_path) -> pd.DataFrame:
 
34
  with fs.open(result_path, "r") as f:
35
  data = json.load(f)
36
  return data
 
2
 
3
  import gradio as gr
4
  import pandas as pd
5
+ from huggingface_hub import HfFileSystem
6
 
7
+ from app import latest_result_path_per_model
8
  from src.constants import RESULTS_DATASET_ID, TASKS
9
 
10
 
11
  def fetch_result_paths():
12
+ fs = HfFileSystem()
13
  paths = fs.glob(f"{RESULTS_DATASET_ID}/**/**/*.json")
14
  return paths
15
 
 
33
 
34
 
35
  def load_data(result_path) -> pd.DataFrame:
36
+ fs = HfFileSystem()
37
  with fs.open(result_path, "r") as f:
38
  data = json.load(f)
39
  return data