Skip to content
TheChatArchiveThe Chat Archive
Metallama-13b· MetaHugging Face Arena Human Preference 55K

Can you provide Python code to download an image from a URL and convert it to a thumbnail?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4-0314’s answer.
  1. User

    Can you provide Python code to download an image from a URL and convert it to a thumbnail?

  2. Meta Assistant

    Here's code that does that using the requests and PIL libraries: from requests import get from PIL import Image from io import BytesIO io = BytesIO() get('https://www.python.org/static/img/python-logo.png', stream=True).read() io.seek(0) thumb = Image.open("python-logo.png") thumb.resize((250, 200), Image.ANTIALIAS) thumb.save(io, format='PNG') io.seek(0) io.read()

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.