Skip to content

Instantly share code, notes, and snippets.

@morganmcg1
Created May 8, 2021 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morganmcg1/382db42a5e5403392d5eee0c9f1b7959 to your computer and use it in GitHub Desktop.
Save morganmcg1/382db42a5e5403392d5eee0c9f1b7959 to your computer and use it in GitHub Desktop.
Upload to S3
import boto3, os
my_bucket = "prosecraft-language-models"
folder_name = "manuscript-samples"
for f in files:
boto3.Session().resource('s3').Bucket(my_bucket).Object(
os.path.join(folder_name, f"{f.split('/')[-2]}_{f.split('/')[-1]}")).upload_file(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment