(url)
| 819 | |
| 820 | |
| 821 | def download_image(url): |
| 822 | original_image = ( |
| 823 | lambda image_url_or_path: load_image(image_url_or_path) |
| 824 | if urlparse(image_url_or_path).scheme |
| 825 | else PIL.Image.open(image_url_or_path).convert("RGB") |
| 826 | )(url) |
| 827 | return original_image |
| 828 | |
| 829 | |
| 830 | # This is for training using deepspeed. |
nothing calls this directly
no outgoing calls
no test coverage detected