From 3e6141a2ab6f5430fcc24373b0ba4b6e4bf78257 Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Tue, 8 Oct 2024 05:57:45 -0500 Subject: [PATCH] Reset Migrations (#20) --- parley/management/commands/analyze.py | 2 +- parley/migrations/0001_initial.py | 96 +++++++++++--- .../0002_prompt_title_sensitive_is_name.py | 31 ----- ..._modify_modelevaluation_metrics_storage.py | 121 ------------------ 4 files changed, 78 insertions(+), 172 deletions(-) delete mode 100644 parley/migrations/0002_prompt_title_sensitive_is_name.py delete mode 100644 parley/migrations/0003_modify_modelevaluation_metrics_storage.py diff --git a/parley/management/commands/analyze.py b/parley/management/commands/analyze.py index 0b4447b..bdde6e1 100644 --- a/parley/management/commands/analyze.py +++ b/parley/management/commands/analyze.py @@ -71,7 +71,7 @@ def handle(self, *args, **opts): # Lookup the model evaluations specified by the user in the database model_evaluations = self.get_queryset(**opts) - n_model_evals = model_evaluations.count() + n_model_evals = model_evaluations.count() if model_evaluations is not None else 0 if n_model_evals == 0: raise CommandError("no model evaluations found for criteria") diff --git a/parley/migrations/0001_initial.py b/parley/migrations/0001_initial.py index 113917d..6577829 100644 --- a/parley/migrations/0001_initial.py +++ b/parley/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1.1 on 2024-10-07 05:47 +# Generated by Django 5.1.1 on 2024-10-08 10:22 import django.db.models.deletion import parley.models.llm @@ -295,6 +295,13 @@ class Migration(migrations.Migration): help_text="If the term is a regular expression to analyze the output on", ), ), + ( + "is_name", + models.BooleanField( + default=False, + help_text="If the term is a proper name that may be extracted and fuzzy searched with NER", + ), + ), ( "case_sensitive", models.BooleanField( @@ -346,35 +353,77 @@ class Migration(migrations.Migration): ("n_prompts", models.IntegerField(default=0, editable=False)), ("n_responses", models.IntegerField(default=0, editable=False)), ( - "similarity_processed", - models.BooleanField(default=False, editable=False), + "n_similar", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), + ), + ( + "n_not_similar", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), + ), + ( + "n_labeled_correctly", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), + ), + ( + "n_labeled_incorrectly", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), + ), + ( + "n_valid_output_type", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), + ), + ( + "n_invalid_output_type", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), + ), + ( + "n_leaks_sensitive", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), ), - ("n_similar", models.IntegerField(default=0, editable=False)), ( - "labels_processed", - models.BooleanField(default=False, editable=False), + "n_no_sensitive_leaks", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), ), - ("n_labeled_correctly", models.IntegerField(default=0, editable=False)), ( - "output_type_processed", - models.BooleanField(default=False, editable=False), + "n_confabulations", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), ), - ("n_valid_output_type", models.IntegerField(default=0, editable=False)), ( - "sensitive_processed", - models.BooleanField(default=False, editable=False), + "n_not_confabulation", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), ), - ("n_leaks_sensitive", models.IntegerField(default=0, editable=False)), ( - "confabulations_processed", - models.BooleanField(default=False, editable=False), + "n_readable", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), ), - ("n_confabulations", models.IntegerField(default=0, editable=False)), ( - "readable_processed", - models.BooleanField(default=False, editable=False), + "n_not_readable", + models.IntegerField( + blank=True, default=None, editable=False, null=True + ), ), - ("n_readable", models.IntegerField(default=0, editable=False)), ( "evaluation", models.ForeignKey( @@ -441,6 +490,15 @@ class Migration(migrations.Migration): help_text="The timestamp that the object was last modified", ), ), + ( + "title", + models.CharField( + blank=True, + default=None, + help_text="A title to specify for identifying the prompt", + null=True, + ), + ), ( "system", models.TextField( diff --git a/parley/migrations/0002_prompt_title_sensitive_is_name.py b/parley/migrations/0002_prompt_title_sensitive_is_name.py deleted file mode 100644 index 45a3ddc..0000000 --- a/parley/migrations/0002_prompt_title_sensitive_is_name.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 5.1.1 on 2024-10-07 16:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("parley", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="prompt", - name="title", - field=models.CharField( - blank=True, - default=None, - help_text="A title to specify for identifying the prompt", - null=True, - ), - ), - migrations.AddField( - model_name="sensitive", - name="is_name", - field=models.BooleanField( - default=False, - help_text="If the term is a proper name that may be extracted and fuzzy searched with NER", - ), - ), - ] diff --git a/parley/migrations/0003_modify_modelevaluation_metrics_storage.py b/parley/migrations/0003_modify_modelevaluation_metrics_storage.py deleted file mode 100644 index c8aee82..0000000 --- a/parley/migrations/0003_modify_modelevaluation_metrics_storage.py +++ /dev/null @@ -1,121 +0,0 @@ -# Generated by Django 5.1.1 on 2024-10-07 20:30 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("parley", "0002_prompt_title_sensitive_is_name"), - ] - - operations = [ - migrations.RemoveField( - model_name="modelevaluation", - name="confabulations_processed", - ), - migrations.RemoveField( - model_name="modelevaluation", - name="labels_processed", - ), - migrations.RemoveField( - model_name="modelevaluation", - name="output_type_processed", - ), - migrations.RemoveField( - model_name="modelevaluation", - name="readable_processed", - ), - migrations.RemoveField( - model_name="modelevaluation", - name="sensitive_processed", - ), - migrations.RemoveField( - model_name="modelevaluation", - name="similarity_processed", - ), - migrations.AddField( - model_name="modelevaluation", - name="n_invalid_output_type", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AddField( - model_name="modelevaluation", - name="n_labeled_incorrectly", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AddField( - model_name="modelevaluation", - name="n_no_sensitive_leaks", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AddField( - model_name="modelevaluation", - name="n_not_confabulation", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AddField( - model_name="modelevaluation", - name="n_not_readable", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AddField( - model_name="modelevaluation", - name="n_not_similar", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AlterField( - model_name="modelevaluation", - name="n_confabulations", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AlterField( - model_name="modelevaluation", - name="n_labeled_correctly", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AlterField( - model_name="modelevaluation", - name="n_leaks_sensitive", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AlterField( - model_name="modelevaluation", - name="n_readable", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AlterField( - model_name="modelevaluation", - name="n_similar", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - migrations.AlterField( - model_name="modelevaluation", - name="n_valid_output_type", - field=models.IntegerField( - blank=True, default=None, editable=False, null=True - ), - ), - ]