Skip to content

Commit e58912f

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Fix bug where class probabilities are read as str instead of floats
1 parent 190ed2e commit e58912f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

openlayer/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import ast
12
import logging
23
import os
34
import shutil
@@ -359,4 +360,9 @@ def run(self, input_data: pd.DataFrame) -> pd.DataFrame:
359360
# Read the output data from the csv file
360361
output_data = pd.read_csv(f"{temp_dir}/output_data.csv")
361362

363+
# Make the items list of floats (and not strings)
364+
output_data["predictions"] = output_data["predictions"].apply(
365+
ast.literal_eval
366+
)
367+
362368
return output_data

0 commit comments

Comments
 (0)