-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboto.py
31 lines (24 loc) · 937 Bytes
/
boto.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 15 18:37:09 2021
@author: imall
"""
import boto3
def model_upload():
#Creating Session With Boto3.
session = boto3.Session(
aws_access_key_id='AKIA4RKVPZNGJ4Q2MKMQ',
aws_secret_access_key='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'
)
#Creating S3 Resource From the Session.
s3 = session.client('s3')
with open("dfscoxmodel.pkl", "rb") as f:
s3.upload_fileobj(f, "predict-or", "dfscoxmodel1.pkl")
with open("lrccoxmodel.pkl", "rb") as f:
s3.upload_fileobj(f, "predict-or", "lrccoxmodel1.pkl")
with open("mfscoxmodel.pkl", "rb") as f:
s3.upload_fileobj(f, "predict-or", "mfscoxmodel1.pkl")
with open("oscoxmodel.pkl", "rb") as f:
s3.upload_fileobj(f, "predict-or", "oscoxmodel1.pkl")
with open("update.txt", "rb") as f:
s3.upload_fileobj(f, "predict-or", "update1.txt")