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

Prevent components from working with non-uploaded files #7465

Merged
merged 12 commits into from
Feb 22, 2024

Conversation

aliabid94
Copy link
Collaborator

No description provided.

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Feb 17, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/dda5a7629b1450d6f69cfe8de24b6302d4be3c49/gradio-4.19.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@dda5a7629b1450d6f69cfe8de24b6302d4be3c49#subdirectory=client/python"

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Feb 17, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Prevent components from working with non-uploaded files

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

I think we need to modify run_fn_batch to accept explicit_call (

def run_fn_batch(self, fn, batch, fn_index, state):
) and also this call to preprocess in the non batch case -
self.preprocess_data, fn_index, inputs, state, limiter=self.limiter

Otherwise looks good to me!

gradio/processing_utils.py Outdated Show resolved Hide resolved
gradio/processing_utils.py Outdated Show resolved Hide resolved
gradio/utils.py Outdated Show resolved Hide resolved
gradio/blocks.py Show resolved Hide resolved
gradio/blocks.py Show resolved Hide resolved
@akx akx mentioned this pull request Feb 19, 2024
@abidlabs abidlabs added the v: patch A change that requires a patch release label Feb 21, 2024
@abidlabs
Copy link
Member

Thanks @aliabid94! This should fix the issue. I would just add a unit test as well, and there's a few nits above.

@PinkDraconian
Copy link

This fix looks great. Thank you for the resolution.
Would you also be able to "accept" my report? That way the process over there moves along.

@aliabid94 aliabid94 merged commit 16fbe9c into main Feb 22, 2024
7 checks passed
@aliabid94 aliabid94 deleted the prevent_nonuploaded_file_access branch February 22, 2024 02:21
@pngwn pngwn mentioned this pull request Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants