📜  python 从 google stroage 下载 sklearm model.joblib - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:36.003000             🧑  作者: Mango

代码示例1
from google.cloud import storage
from sklearn.externals import joblib
from io import BytesIO

storage_client = storage.Client()
bucket_name=
model_bucket='model.joblib'

bucket = storage_client.get_bucket(bucket_name)
#select bucket file
blob = bucket.blob(model_bucket)
#download blob into an in-memory file object
model_file = BytesIO()
blob.download_to_file(model_file)
#load into joblib
model=joblib.load(model_local)