|
|
|
|
|
from dataclasses import dataclass |
|
from enum import Enum |
|
from typing import Any, List |
|
|
|
from src.about import Tasks |
|
|
|
@dataclass |
|
class ColumnContent: |
|
name: str |
|
type: Any |
|
label: str |
|
description: str |
|
hidden: bool = False |
|
displayed_by_default: bool = True |
|
never_hidden: bool = False |
|
|
|
|
|
COLUMNS: List[ColumnContent] = [] |
|
|
|
|
|
COLUMNS.append( |
|
ColumnContent( |
|
name="model", |
|
type=str, |
|
label="Model", |
|
description="Model name", |
|
never_hidden=True, |
|
) |
|
) |
|
COLUMNS.append( |
|
ColumnContent( |
|
name="average", |
|
type=float, |
|
label="Average Accuracy (%)", |
|
description="Average accuracy across all subjects", |
|
) |
|
) |
|
|
|
|
|
for task in Tasks: |
|
COLUMNS.append( |
|
ColumnContent( |
|
name=task.value.benchmark, |
|
type=float, |
|
label=f"{task.value.col_name} (%)", |
|
description=f"Accuracy on {task.value.col_name}", |
|
displayed_by_default=True, |
|
) |
|
) |
|
|
|
|
|
COLUMNS.extend([ |
|
ColumnContent( |
|
name="model_type", |
|
type=str, |
|
label="Model Type", |
|
description="Type of the model (e.g., Transformer, RNN, etc.)", |
|
displayed_by_default=True, |
|
), |
|
ColumnContent( |
|
name="weight_type", |
|
type=str, |
|
label="Weight Type", |
|
description="Type of model weights (e.g., Original, Delta, Adapter)", |
|
displayed_by_default=True, |
|
), |
|
ColumnContent( |
|
name="precision", |
|
type=str, |
|
label="Precision", |
|
description="Precision of the model weights (e.g., float16)", |
|
displayed_by_default=True, |
|
), |
|
ColumnContent( |
|
name="license", |
|
type=str, |
|
label="License", |
|
description="License of the model", |
|
displayed_by_default=True, |
|
), |
|
ColumnContent( |
|
name="likes", |
|
type=int, |
|
label="Likes", |
|
description="Number of likes on the Hugging Face Hub", |
|
displayed_by_default=True, |
|
), |
|
ColumnContent( |
|
name="still_on_hub", |
|
type=bool, |
|
label="Available on the Hub", |
|
description="Whether the model is still available on the Hugging Face Hub", |
|
displayed_by_default=True, |
|
), |
|
]) |
|
|
|
|
|
COLS = [col.name for col in COLUMNS] |
|
BENCHMARK_COLS = [col.name for col in COLUMNS if col.name not in [ |
|
"model", "average", "model_type", "weight_type", "precision", "license", "likes", "still_on_hub" |
|
]] |
|
|