diff --git a/parlance/views.py b/parlance/views.py index 2a2c5cf..ef2e175 100644 --- a/parlance/views.py +++ b/parlance/views.py @@ -19,6 +19,7 @@ from django.shortcuts import render from django.views.generic import TemplateView +from parley.models import LLM, Evaluation, Prompt, Response ########################################################################## @@ -32,6 +33,17 @@ class Dashboard(TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['page_id'] = "dashboard" + + # Get statistics for stat cards + context['n_llms'] = LLM.objects.count() + context["n_evaluations"] = Evaluation.objects.count() + context["n_prompts"] = Prompt.objects.count() + context["n_responses"] = Response.objects.count() + + # Get evaluations and models + context["evaluations"] = Evaluation.objects.filter(active=True) + context["llms"] = LLM.objects.all()[:20] + return context diff --git a/templates/components/statcard.html b/templates/components/statcard.html new file mode 100644 index 0000000..90b03ad --- /dev/null +++ b/templates/components/statcard.html @@ -0,0 +1,22 @@ +
+ {{ evaluation.task }} +
+ + ++ {{ evaluation.prompts.count }} prompts +
+ +Name | +Type | +Responses | +
---|---|---|
{{model.name}} v{{ model.version }} | +{% if model.is_adapter_model %}LoRA{% else %}Base{% endif %} | +{{model.responses.count}} | +