From 80505c199abcdb69e3194168274b6ea641459c40 Mon Sep 17 00:00:00 2001 From: Kartik Pradeepan Date: Mon, 9 Feb 2026 12:02:57 -0500 Subject: [PATCH 1/6] Introduce model groups (migration and explore page update) --- benchmarks/migrations/0022_model_group.py | 16 +++++++++++ benchmarks/models.py | 6 ++++ benchmarks/templates/benchmarks/explore.html | 23 +++++++++++++--- benchmarks/views/explore.py | 29 ++++++++++++++++---- 4 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 benchmarks/migrations/0022_model_group.py diff --git a/benchmarks/migrations/0022_model_group.py b/benchmarks/migrations/0022_model_group.py new file mode 100644 index 000000000..c6985a9a1 --- /dev/null +++ b/benchmarks/migrations/0022_model_group.py @@ -0,0 +1,16 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('benchmarks', '0021_change_meta_fields_to_foreignkey'), + ] + + operations = [ + migrations.AddField( + model_name='model', + name='group', + field=models.CharField(max_length=50, default=None, null=True), + ), + ] diff --git a/benchmarks/models.py b/benchmarks/models.py index 524b870d4..be0765c59 100644 --- a/benchmarks/models.py +++ b/benchmarks/models.py @@ -218,6 +218,11 @@ class Meta: class Model(models.Model): + class Group: + REFERENCE = 'reference' + TOP10_2024 = 'top10_2024' + BASE = 'base' + id = models.AutoField(primary_key=True) name = models.CharField(max_length=200) owner = models.ForeignKey(User, on_delete=models.PROTECT) @@ -227,6 +232,7 @@ class Model(models.Model): public = models.BooleanField(default=False) competition = models.CharField(max_length=200, default=None, null=True) domain = models.CharField(max_length=200, default="vision") + group = models.CharField(max_length=50, default=None, null=True) def __repr__(self): return generic_repr(self) diff --git a/benchmarks/templates/benchmarks/explore.html b/benchmarks/templates/benchmarks/explore.html index e3cc4abb5..a7bcb5a89 100644 --- a/benchmarks/templates/benchmarks/explore.html +++ b/benchmarks/templates/benchmarks/explore.html @@ -22,13 +22,28 @@

{{ benchmarks|length }} public Benchmarks

+ {% if representative_models %} +
+

Representative Models

+
+ {% for model in representative_models %} + {{ model.name }} + {% endfor %} +
+
+
+ {% endif %} +
- {% for model in models %} - {{ model.name }} - {% endfor %} +

Other Models

+
+ {% for model in other_models %} + {{ model.name }} + {% endfor %} +
diff --git a/benchmarks/views/explore.py b/benchmarks/views/explore.py index 6dc92442f..9feacc4b9 100644 --- a/benchmarks/views/explore.py +++ b/benchmarks/views/explore.py @@ -4,14 +4,33 @@ def view(request, domain): - models = (Model.objects - .filter(domain=domain, public=True) - .order_by('name') - .values('name', 'id')) + base_query = Model.objects.filter(domain=domain, public=True) + + representative_groups = [Model.Group.REFERENCE, Model.Group.TOP10_2024, Model.Group.BASE] + + representative_models = (base_query + .filter(group__in=representative_groups) + .order_by('name') + .values('name', 'id')) + + other_models = (base_query + .filter(group__isnull=True) + .order_by('name') + .values('name', 'id')) + + total_model_count = base_query.count() + benchmarks = (BenchmarkInstance.objects .filter(benchmark_type__domain=domain, benchmark_type__visible=True) .order_by('benchmark_type__identifier', '-version') .distinct('benchmark_type__identifier') .values('id', 'benchmark_type__identifier', 'version')) - context = {'domain': domain, 'models': models, 'benchmarks': benchmarks} + + context = { + 'domain': domain, + 'representative_models': representative_models, + 'other_models': other_models, + 'total_model_count': total_model_count, + 'benchmarks': benchmarks, + } return render(request, 'benchmarks/explore.html', context) From dabcf08f31307c96e740da21ca6dd842a29b815e Mon Sep 17 00:00:00 2001 From: Kartik Pradeepan Date: Mon, 9 Feb 2026 13:10:49 -0500 Subject: [PATCH 2/6] Add model count and info about representative set --- benchmarks/templates/benchmarks/explore.html | 11 ++++++++++- static/benchmarks/css/components/tooltip.sass | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/benchmarks/templates/benchmarks/explore.html b/benchmarks/templates/benchmarks/explore.html index a7bcb5a89..9f7497dc7 100644 --- a/benchmarks/templates/benchmarks/explore.html +++ b/benchmarks/templates/benchmarks/explore.html @@ -8,6 +8,7 @@

Explore Benchmarks and Models

{% block content %} +