I’ve successfully used the following snippet to call the classifier specified below, with small images. When using the image such as the below (< 1MB), I see 413 errors. From other forum posts I believe the file size is not the real problem here; what might I be missing?
import requests
import gradio as gr
from IPython.display import Image
from IPython.core.display import HTMLimage_url = ‘https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_square.jpg’
data = gr.processing_utils.encode_url_or_file_to_base64(image_url)
r = requests.post(url=‘https://hf.space/embed/tmabraham/fastai_pet_classifier/+/api/predict/’, json={“data”:[data]})print(r)
print(r.json())
print(“-----”)print(f"The breed of this pet is a {(’ ‘.join(r.json()[‘data’][0][‘label’].split(’_')))}:")