Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code to handle non-image uploads in runpod.serverless.utils.rp_upload.files(...) #160

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

MartinKlefas
Copy link
Contributor

The existing upload code assumes that the user is trying to upload an image, and forces the S3 content type to PNG regardless of what the file actually is.

This version first tries an image-based approach, setting the content type by the image type, and then falls back to a file-based upload.

Any exceptions caused by anything other than PIL detecting it's not an image will still be handled in the remainder of the code.

from boto3 import session
from boto3.s3.transfer import TransferConfig
from botocore.config import Config
from tqdm_loggable.auto import tqdm



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else looks good, I almost feel bad asking for the one change to get rid of this extra blank line :)

@justinmerrell
Copy link
Member

Solid contribution, just a super minor nit-picking change request and then it should be good to merge :)

@MartinKlefas
Copy link
Contributor Author

I'd say a solid 50% of my code base is extra blank lines - happy to remove one or two!

@justinmerrell justinmerrell merged commit 0292e4b into runpod:main Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants