Skip to content

Commit eb893ce

Browse files
committed
Added some helper scripts
1 parent fbe73af commit eb893ce

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

detectors/detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_detector(detector_name: str) -> Detector:
5151
return OriginalityAI()
5252
elif detector_name == "binoculars":
5353
return Binoculars()
54-
if detector_name == "conda":
54+
elif detector_name == "conda":
5555
return Conda()
5656
else:
5757
raise ValueError("Invalid detector name")

run_pred_eval.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
print(f"Running detection...")
3737
results = run_detection(detector.inference, df)
3838

39-
print(f"Done! Writing predictions to output path: {args.output_path}")
39+
print(f"Done! Writing predictions to output path: {args.output_preds_path}")
4040
with open(args.output_preds_path, "w") as f:
4141
json.dump(results, f)
4242

43-
if "label" not in df.columns:
44-
print("No labels found in dataframe; evaluation will not be run.")
45-
exit(0)
43+
# if "label" not in df.columns:
44+
# print("No labels found in dataframe; evaluation will not be run.")
45+
# exit(0)
4646

4747
print("Running evaluation on the predictions...")
4848
evaluation_result = run_evaluation(results, df)

visualize_results_file.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
print(f"{d} -- {accuracy.item()}")
2424
except Exception:
2525
pass
26+
27+
# for m in df.model.unique():
28+
# accuracy = df[(df['model'] == m) & (df['domain'] == 'all') & (df['attack'] == 'none') & (df['decoding'] == 'all') & (df['repetition_penalty'] == 'all')]['auroc']
29+
# try:
30+
# print(f"{m} -- {accuracy.item()}")
31+
# except Exception:
32+
# pass
2633
#print(df)
2734

2835
# # Conditions

0 commit comments

Comments
 (0)