code quality fixes
This commit is contained in:
@@ -278,7 +278,6 @@ if __name__ == "__main__":
|
|||||||
experiment = mlflow.get_experiment_by_name("visual-semiotic-ai-analysis")
|
experiment = mlflow.get_experiment_by_name("visual-semiotic-ai-analysis")
|
||||||
experiment_id = experiment.experiment_id if experiment else None
|
experiment_id = experiment.experiment_id if experiment else None
|
||||||
# Calculate accuracy
|
# Calculate accuracy
|
||||||
category_events = {}
|
|
||||||
for category, initial_prompt in CATEGORY_PROMPT_MAP.items():
|
for category, initial_prompt in CATEGORY_PROMPT_MAP.items():
|
||||||
step = 0
|
step = 0
|
||||||
run = mlflow.start_run(
|
run = mlflow.start_run(
|
||||||
@@ -309,8 +308,10 @@ if __name__ == "__main__":
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
# Calculate accuracy for refined prompt
|
# Calculate accuracy for refined prompt
|
||||||
accuracy = calculate_model_prompt_accuracy(MODEL, refined_prompt, category)
|
accuracy = calculate_model_prompt_accuracy(
|
||||||
mlflow.log_metric(f"accuracy", accuracy, step=step)
|
MODEL, refined_prompt, category
|
||||||
|
)
|
||||||
|
mlflow.log_metric("accuracy", accuracy, step=step)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error calculating accuracy: {e}")
|
print(f"Error calculating accuracy: {e}")
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user