Answers for "python download sklearm model.joblib from google stroage"

0

python download sklearm model.joblib from google stroage

from google.cloud import storage
from sklearn.externals import joblib
from io import BytesIO

storage_client = storage.Client()
bucket_name=<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)
Posted by: Guest on April-18-2020

Code answers related to "python download sklearm model.joblib from google stroage"

Python Answers by Framework

Browse Popular Code Answers by Language