Fix formatting in prediction output: Remove space before commas in saved predictions
Browse files- src/my_utils.py +1 -1
src/my_utils.py
CHANGED
|
@@ -838,7 +838,7 @@ def save_predictions_to_txt(predictions_dict: dict[str, tuple[list[str], list[fl
|
|
| 838 |
|
| 839 |
# Create the prediction string: "Class1 (prob1), Class2 (prob2), ..."
|
| 840 |
pred_strings = [f"{cls} ({prob:.4f})" for cls, prob in zip(class_names, probabilities)]
|
| 841 |
-
pred_line = ",
|
| 842 |
|
| 843 |
f.write(f"{seq_id},{pred_line}\n")
|
| 844 |
|
|
|
|
| 838 |
|
| 839 |
# Create the prediction string: "Class1 (prob1), Class2 (prob2), ..."
|
| 840 |
pred_strings = [f"{cls} ({prob:.4f})" for cls, prob in zip(class_names, probabilities)]
|
| 841 |
+
pred_line = ",".join(pred_strings)
|
| 842 |
|
| 843 |
f.write(f"{seq_id},{pred_line}\n")
|
| 844 |
|