We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
from_file
1 parent 8d810c2 commit e8478b2Copy full SHA for e8478b2
pysr/sr.py
@@ -878,6 +878,11 @@ def from_file(
878
assert n_features_in is None
879
with open(pkl_filename, "rb") as f:
880
model = pkl.load(f)
881
+ # Change equation_file_ to be in the same dir as the pickle file
882
+ base_dir = os.path.dirname(pkl_filename)
883
+ base_equation_file = os.path.basename(model.equation_file_)
884
+ model.equation_file_ = os.path.join(base_dir, base_equation_file)
885
+
886
# Update any parameters if necessary, such as
887
# extra_sympy_mappings:
888
model.set_params(**pysr_kwargs)
0 commit comments