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
812d1aa350
commit
4787b0dbd2
1 changed files with 6 additions and 2 deletions
|
|
@ -42,16 +42,20 @@ def load(file_or_path):
|
||||||
|
|
||||||
:param file_name: path/to/file.pickle
|
:param file_name: path/to/file.pickle
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
|
str = basestring
|
||||||
|
except:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
if isinstance(file_or_path, basestring):
|
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)
|
m = pickle.load(f)
|
||||||
else:
|
else:
|
||||||
m = pickle.load(file_or_path)
|
m = pickle.load(file_or_path)
|
||||||
except:
|
except:
|
||||||
import pickle
|
import pickle
|
||||||
if isinstance(file_or_path, basestring):
|
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)
|
m = pickle.load(f)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue