oops
This commit is contained in:
parent
bcedd2ab3d
commit
84369d6c78
|
@ -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:
|
||||
|
|
Reference in New Issue