Error when I try to extract image data and run it through a server function on google colab

What I’m trying to do:
I have a function on a google colab notebook which I connected to the document. What I’m trying to do is run that function on an image input and produce the output that my google function outputs.

What I’ve tried and what’s not working:
I’ve tried taking the image data from the uploaded image since I can’t pass a form through a server function, but when I do that, I keep getting errors saying “An error occurred: Cannot pass bytes object to a server function: arguments [0],” and when I don’t convert to bytes, “An error occurred: a bytes-like object is required, not 'StreamingMedia”

Code Sample:
Server Code:
import anvil.server
import base64
from io import BytesIO
from PIL import Image

@anvil.server.callable
def get_prediction(file_base64, content_type, file_name):
# Decode the Base64 string into bytes
file_bytes = base64.b64decode(file_base64)

# Log the received file info
print(f"Received file: {file_name} with content type: {content_type}")
print(f"File size: {len(file_bytes)} bytes")

# Open the image (if it's an image file)
image = Image.open(BytesIO(file_bytes))

return anvil.server.call("get_prediction", image)

Form code:
def Diagnose_click(self, **event_args):
“”“This method is called when the user clicks the ‘Diagnose’ button.”“”
# Check if an image has been uploaded
if not self.file_loader_1.files:
self.result_label.text = “Please upload an image.”
return

# Get the uploaded image file (first file in the list)
image_file = self.file_loader_1.files[0]

try:
    # Wrap the uploaded file into a BlobMedia object
    blob_media = anvil.BlobMedia(
        content_type=image_file.content_type,
        content=image_file.get_bytes(),
        name=image_file.name
    )

    # Call the server function with the BlobMedia object
    predicted_label = anvil.server.call("get_prediction", blob_media)

    # Display the prediction result
    self.result_label.text = f"Prediction: {predicted_label}"
    self.result_label.visible = True
except Exception as e:
    # Handle errors and display the message
    alert(f"An error occurred: {str(e)}")