(url)
| 830 | |
| 831 | |
| 832 | def download_image(url): |
| 833 | original_image = ( |
| 834 | lambda image_url_or_path: load_image(image_url_or_path) |
| 835 | if urlparse(image_url_or_path).scheme |
| 836 | else PIL.Image.open(image_url_or_path).convert("RGB") |
| 837 | )(url) |
| 838 | return original_image |
| 839 | |
| 840 | |
| 841 | # This is for training using deepspeed. |
nothing calls this directly
no outgoing calls
no test coverage detected