pufanyi commited on
Commit
ab7ee2d
·
1 Parent(s): 7660cbc

chore: Update app.py to include select_columns and hide_columns in init_leaderboard function

Browse files
Files changed (2) hide show
  1. app.py +3 -15
  2. src/display/utils.py +0 -52
app.py CHANGED
@@ -64,21 +64,9 @@ def init_leaderboard(dataframe):
64
  ),
65
  search_columns=[AutoEvalColumn.model.name],
66
  hide_columns=[c.name for c in fields(AutoEvalColumn) if c.hidden],
67
- # filter_columns=[
68
- # ColumnFilter(AutoEvalColumn.model_type.name, type="checkboxgroup", label="Model types"),
69
- # ColumnFilter(AutoEvalColumn.precision.name, type="dropdown", label="Precision"),
70
- # ColumnFilter(
71
- # AutoEvalColumn.params.name,
72
- # type="slider",
73
- # min=0.01,
74
- # max=150,
75
- # label="Select the number of parameters (B)",
76
- # ),
77
- # ColumnFilter(
78
- # AutoEvalColumn.still_on_hub.name, type="boolean", label="Deleted/incomplete", default=True
79
- # ),
80
- # ],
81
- # bool_checkboxgroup_label="Hide models",
82
  interactive=False,
83
  )
84
 
 
64
  ),
65
  search_columns=[AutoEvalColumn.model.name],
66
  hide_columns=[c.name for c in fields(AutoEvalColumn) if c.hidden],
67
+ filter_columns=[
68
+ ColumnFilter(AutoEvalColumn.model.name, type="dropdown", label="Select Model"),
69
+ ],
 
 
 
 
 
 
 
 
 
 
 
 
70
  interactive=False,
71
  )
72
 
src/display/utils.py CHANGED
@@ -51,57 +51,6 @@ class ModelDetails:
51
  symbol: str = "" # emoji
52
 
53
 
54
- class ModelType(Enum):
55
- PT = ModelDetails(name="pretrained", symbol="🟢")
56
- FT = ModelDetails(name="fine-tuned", symbol="🔶")
57
- IFT = ModelDetails(name="instruction-tuned", symbol="â­•")
58
- RL = ModelDetails(name="RL-tuned", symbol="🟦")
59
- Unknown = ModelDetails(name="", symbol="?")
60
-
61
- def to_str(self, separator=" "):
62
- return f"{self.value.symbol}{separator}{self.value.name}"
63
-
64
- @staticmethod
65
- def from_str(type):
66
- if "fine-tuned" in type or "🔶" in type:
67
- return ModelType.FT
68
- if "pretrained" in type or "🟢" in type:
69
- return ModelType.PT
70
- if "RL-tuned" in type or "🟦" in type:
71
- return ModelType.RL
72
- if "instruction-tuned" in type or "â­•" in type:
73
- return ModelType.IFT
74
- return ModelType.Unknown
75
-
76
- class WeightType(Enum):
77
- Adapter = ModelDetails("Adapter")
78
- Original = ModelDetails("Original")
79
- Delta = ModelDetails("Delta")
80
-
81
- class Precision(Enum):
82
- float16 = ModelDetails("float16")
83
- bfloat16 = ModelDetails("bfloat16")
84
- float32 = ModelDetails("float32")
85
- #qt_8bit = ModelDetails("8bit")
86
- #qt_4bit = ModelDetails("4bit")
87
- #qt_GPTQ = ModelDetails("GPTQ")
88
- Unknown = ModelDetails("?")
89
-
90
- def from_str(precision):
91
- if precision in ["torch.float16", "float16"]:
92
- return Precision.float16
93
- if precision in ["torch.bfloat16", "bfloat16"]:
94
- return Precision.bfloat16
95
- if precision in ["float32"]:
96
- return Precision.float32
97
- #if precision in ["8bit"]:
98
- # return Precision.qt_8bit
99
- #if precision in ["4bit"]:
100
- # return Precision.qt_4bit
101
- #if precision in ["GPTQ", "None"]:
102
- # return Precision.qt_GPTQ
103
- return Precision.Unknown
104
-
105
  # Column selection
106
  COLS = [c.name for c in fields(AutoEvalColumn) if not c.hidden]
107
 
@@ -109,4 +58,3 @@ EVAL_COLS = [c.name for c in fields(EvalQueueColumn)]
109
  EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
110
 
111
  BENCHMARK_COLS = [t.value.col_name for t in Tasks]
112
-
 
51
  symbol: str = "" # emoji
52
 
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  # Column selection
55
  COLS = [c.name for c in fields(AutoEvalColumn) if not c.hidden]
56
 
 
58
  EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
59
 
60
  BENCHMARK_COLS = [t.value.col_name for t in Tasks]