Alina Lozovskaia commited on
Commit
122c7af
1 Parent(s): 6b9cbbe

Updated gitignore

Browse files
Files changed (2) hide show
  1. .gitignore +5 -0
  2. src/tools/collections.py +4 -4
.gitignore CHANGED
@@ -1,10 +1,15 @@
1
  venv/
 
2
  __pycache__/
3
  .env
4
  .ipynb_checkpoints
5
  *ipynb
6
  .vscode/
7
  .DS_Store
 
 
 
 
8
 
9
  eval-queue/
10
  eval-results/
 
1
  venv/
2
+ .venv/
3
  __pycache__/
4
  .env
5
  .ipynb_checkpoints
6
  *ipynb
7
  .vscode/
8
  .DS_Store
9
+ .ruff_cache/
10
+ .python-version
11
+ .profile_app.python
12
+ *pstats
13
 
14
  eval-queue/
15
  eval-results/
src/tools/collections.py CHANGED
@@ -17,7 +17,7 @@ intervals = {
17
  }
18
 
19
 
20
- def filter_by_type_and_size(df, model_type, size_interval):
21
  """Filter DataFrame by model type and parameter size interval."""
22
  type_emoji = model_type.value.symbol[0]
23
  filtered_df = df[df[AutoEvalColumn.model_type_symbol.name] == type_emoji]
@@ -26,7 +26,7 @@ def filter_by_type_and_size(df, model_type, size_interval):
26
  return filtered_df.loc[mask]
27
 
28
 
29
- def add_models_to_collection(collection, models, model_type, size):
30
  """Add best models to the collection and update positions."""
31
  cur_len_collection = len(collection.items)
32
  for ix, model in enumerate(models, start=1):
@@ -58,12 +58,12 @@ def update_collections(df: DataFrame):
58
  if not model_type.value.name:
59
  continue
60
  for size, interval in intervals.items():
61
- filtered_df = filter_by_type_and_size(df, model_type, interval)
62
  best_models = list(
63
  filtered_df.sort_values(AutoEvalColumn.average.name, ascending=False)[AutoEvalColumn.dummy.name][:10]
64
  )
65
  print(model_type.value.symbol, size, best_models[:10])
66
- add_models_to_collection(collection, best_models, model_type, size)
67
  cur_best_models.extend(best_models)
68
 
69
  # Cleanup
 
17
  }
18
 
19
 
20
+ def _filter_by_type_and_size(df, model_type, size_interval):
21
  """Filter DataFrame by model type and parameter size interval."""
22
  type_emoji = model_type.value.symbol[0]
23
  filtered_df = df[df[AutoEvalColumn.model_type_symbol.name] == type_emoji]
 
26
  return filtered_df.loc[mask]
27
 
28
 
29
+ def _add_models_to_collection(collection, models, model_type, size):
30
  """Add best models to the collection and update positions."""
31
  cur_len_collection = len(collection.items)
32
  for ix, model in enumerate(models, start=1):
 
58
  if not model_type.value.name:
59
  continue
60
  for size, interval in intervals.items():
61
+ filtered_df = _filter_by_type_and_size(df, model_type, interval)
62
  best_models = list(
63
  filtered_df.sort_values(AutoEvalColumn.average.name, ascending=False)[AutoEvalColumn.dummy.name][:10]
64
  )
65
  print(model_type.value.symbol, size, best_models[:10])
66
+ _add_models_to_collection(collection, best_models, model_type, size)
67
  cur_best_models.extend(best_models)
68
 
69
  # Cleanup