mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-20 09:03:39 +00:00
Use pathlib to load model file (#1835)
This commit is contained in:
parent
b5e67e59c3
commit
8882c6a3e3
1 changed files with 2 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ from abc import abstractmethod, ABC
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
from pathlib import Path
|
||||||
import pickle
|
import pickle
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import os
|
import os
|
||||||
|
|
@ -282,7 +283,7 @@ class PyStanBackend(IStanBackend):
|
||||||
'fbprophet',
|
'fbprophet',
|
||||||
'stan_model/prophet_model.pkl',
|
'stan_model/prophet_model.pkl',
|
||||||
)
|
)
|
||||||
with open(model_file, 'rb') as f:
|
with Path(model_file).open('rb') as f:
|
||||||
return pickle.load(f)
|
return pickle.load(f)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue