This commit is contained in:
Cyberes 2023-09-13 11:30:22 -06:00
parent bcedd2ab3d
commit 84369d6c78
1 changed files with 2 additions and 2 deletions

View File

@ -135,14 +135,14 @@ def average_column_for_model(table_name, column_name, model_name):
def weighted_average_column_for_model(table_name, column_name, model_name, backend_name, exclude_zeros: bool = False):
conn = sqlite3.connect(opts.database_path)
cursor = conn.cursor()
cursor.execute(f"SELECT DISTINCT model, backend FROM {table_name}")
cursor.execute(f"SELECT DISTINCT model, backend_mode FROM {table_name}")
models_backends = [(row[0], row[1]) for row in cursor.fetchall()]
model_averages = {}
for model, backend in models_backends:
if backend != backend_name:
continue
cursor.execute(f"SELECT {column_name}, ROWID FROM {table_name} WHERE model = ? AND backend = ? ORDER BY ROWID DESC", (model, backend))
cursor.execute(f"SELECT {column_name}, ROWID FROM {table_name} WHERE model = ? AND backend_mode = ? ORDER BY ROWID DESC", (model, backend))
results = cursor.fetchall()
if not results: