brunneis commited on
Commit
0296a03
1 Parent(s): 1ed5d75

Update precisions

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. src/display/utils.py +23 -10
app.py CHANGED
@@ -163,7 +163,7 @@ with demo:
163
  row_count=5,
164
  )
165
  with gr.Row():
166
- gr.Markdown("# ✉️ Submit a model", elem_classes="markdown-text")
167
 
168
  with gr.Row():
169
  with gr.Column():
 
163
  row_count=5,
164
  )
165
  with gr.Row():
166
+ gr.Markdown("# ✉️ New submission", elem_classes="markdown-text")
167
 
168
  with gr.Row():
169
  with gr.Column():
src/display/utils.py CHANGED
@@ -17,6 +17,8 @@ def fields(raw_class):
17
  # These classes are for user facing column names,
18
  # to avoid having to change them all around the code
19
  # when a modif is needed
 
 
20
  @dataclass
21
  class ColumnContent:
22
  name: str
@@ -30,9 +32,12 @@ class ColumnContent:
30
  def create_column_content(name, type='str', displayed_by_default=False, hidden=False, never_hidden=False):
31
  return field(default_factory=lambda: ColumnContent(name, type, displayed_by_default, hidden, never_hidden))
32
 
 
33
  auto_eval_column_dict = [
34
- ("model_type_symbol", ColumnContent, create_column_content("", "str", True, never_hidden=True)),
35
- ("model", ColumnContent, create_column_content("Model", "markdown", True, never_hidden=True)),
 
 
36
  ("average", ColumnContent, create_column_content("Average", "number", True)),
37
  ]
38
 
@@ -71,12 +76,16 @@ model_info_columns = [
71
 
72
  for col_name, display_name, col_type, displayed_by_default, *args in model_info_columns:
73
  hidden = args[0] if args else False
74
- auto_eval_column_dict.append((col_name, ColumnContent, create_column_content(display_name, col_type, displayed_by_default, hidden)))
 
75
 
76
  # Create the AutoEvalColumn dataclass
77
- AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)()
 
78
 
79
  # For the requests columns in the submission tab
 
 
80
  @dataclass(frozen=True)
81
  class EvalQueueColumn: # Queue column
82
  model = ColumnContent("model", "markdown", True)
@@ -124,19 +133,23 @@ class WeightType(Enum):
124
  class Precision(Enum):
125
  float16 = ModelDetails("float16")
126
  bfloat16 = ModelDetails("bfloat16")
127
- float32 = ModelDetails("float32")
128
- bfloat32 = ModelDetails("bfloat32")
 
129
  Unknown = ModelDetails("Unknown")
130
 
 
131
  def from_str(precision):
132
  if precision in ["torch.float16", "float16"]:
133
  return Precision.float16
134
  if precision in ["torch.bfloat16", "bfloat16"]:
135
  return Precision.bfloat16
136
- if precision in ["torch.float32", "float32"]:
137
- return Precision.float32
138
- if precision in ["torch.bfloat32", "bfloat32"]:
139
- return Precision.bfloat32
 
 
140
  return Precision.Unknown
141
 
142
 
 
17
  # These classes are for user facing column names,
18
  # to avoid having to change them all around the code
19
  # when a modif is needed
20
+
21
+
22
  @dataclass
23
  class ColumnContent:
24
  name: str
 
32
  def create_column_content(name, type='str', displayed_by_default=False, hidden=False, never_hidden=False):
33
  return field(default_factory=lambda: ColumnContent(name, type, displayed_by_default, hidden, never_hidden))
34
 
35
+
36
  auto_eval_column_dict = [
37
+ ("model_type_symbol", ColumnContent, create_column_content(
38
+ "", "str", True, never_hidden=True)),
39
+ ("model", ColumnContent, create_column_content(
40
+ "Model", "markdown", True, never_hidden=True)),
41
  ("average", ColumnContent, create_column_content("Average", "number", True)),
42
  ]
43
 
 
76
 
77
  for col_name, display_name, col_type, displayed_by_default, *args in model_info_columns:
78
  hidden = args[0] if args else False
79
+ auto_eval_column_dict.append((col_name, ColumnContent, create_column_content(
80
+ display_name, col_type, displayed_by_default, hidden)))
81
 
82
  # Create the AutoEvalColumn dataclass
83
+ AutoEvalColumn = make_dataclass(
84
+ "AutoEvalColumn", auto_eval_column_dict, frozen=True)()
85
 
86
  # For the requests columns in the submission tab
87
+
88
+
89
  @dataclass(frozen=True)
90
  class EvalQueueColumn: # Queue column
91
  model = ColumnContent("model", "markdown", True)
 
133
  class Precision(Enum):
134
  float16 = ModelDetails("float16")
135
  bfloat16 = ModelDetails("bfloat16")
136
+ qt_8bit = ModelDetails("8bit")
137
+ qt_4bit = ModelDetails("4bit")
138
+ qt_GPTQ = ModelDetails("GPTQ")
139
  Unknown = ModelDetails("Unknown")
140
 
141
+ @staticmethod
142
  def from_str(precision):
143
  if precision in ["torch.float16", "float16"]:
144
  return Precision.float16
145
  if precision in ["torch.bfloat16", "bfloat16"]:
146
  return Precision.bfloat16
147
+ if precision in ["8bit"]:
148
+ return Precision.qt_8bit
149
+ if precision in ["4bit"]:
150
+ return Precision.qt_4bit
151
+ if precision in ["GPTQ", "None"]:
152
+ return Precision.qt_GPTQ
153
  return Precision.Unknown
154
 
155