mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
Update __init__.py
This commit is contained in:
parent
d1f4af7ec2
commit
1fe037c5f9
1 changed files with 4 additions and 1 deletions
|
|
@ -50,11 +50,14 @@ def load(file_or_path):
|
||||||
u.encoding = 'latin1'
|
u.encoding = 'latin1'
|
||||||
m = u.load()
|
m = u.load()
|
||||||
else:
|
else:
|
||||||
|
m = pickle.load(file_or_path)
|
||||||
except:
|
except:
|
||||||
import pickle
|
import pickle
|
||||||
if isinstance(file_or_path, str):
|
if isinstance(file_or_path, str):
|
||||||
with open(file_or_path, 'rb') as f:
|
with open(file_or_path, 'rb') as f:
|
||||||
m = pickle.load(f)
|
u = pickle._Unpickler(f)
|
||||||
|
u.encoding = 'latin1'
|
||||||
|
m = u.load()
|
||||||
else:
|
else:
|
||||||
m = pickle.load(file_or_path)
|
m = pickle.load(file_or_path)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue