mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-29 06:46:22 +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
|
||||
"""
|
||||
try:
|
||||
str = basestring
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
import cPickle as pickle
|
||||
if isinstance(file_or_path, basestring):
|
||||
if isinstance(file_or_path, str):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
m = pickle.load(file_or_path)
|
||||
except:
|
||||
import pickle
|
||||
if isinstance(file_or_path, basestring):
|
||||
if isinstance(file_or_path, str):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue