From 1bebb9e76b795c74a85c1706461a211cebf20615 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Tue, 3 Oct 2023 12:25:06 +0200 Subject: [PATCH] Update idefics_image_processing.py (#1091) # What does this PR do? Fixes # (issue) ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. --- .../models/custom_modeling/idefics_image_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/text_generation_server/models/custom_modeling/idefics_image_processing.py b/server/text_generation_server/models/custom_modeling/idefics_image_processing.py index 061243fb5b1..28525e86172 100644 --- a/server/text_generation_server/models/custom_modeling/idefics_image_processing.py +++ b/server/text_generation_server/models/custom_modeling/idefics_image_processing.py @@ -198,7 +198,7 @@ def fetch_images(self, image_url_or_urls: Union[str, List[str]]): response.raise_for_status() try: image = Image.open(BytesIO(response.content)) - image.verify() + # image.verify() except Exception: raise ValueError(f"Could not load image from url {image_url_or_urls}") return image