code: def test_np_in_composed_model(serve_instance):
      # https://github.com/ray-project/ray/issues/9441
      # AttributeError: 'bytes' object has no attribute 'readonly'
      # in cloudpickle _from_numpy_buffer
  
      @serve.deployment
      class Sum:
          def __call__(self, data):
              return np.sum(data)
  
      @serve.deployment(name="model")
      class ComposedModel:
          def __init__(self, handle: DeploymentHandle):
              self.model = handle
  
          async def __call__(self):
              data = np.ones((10, 10))
              return await self.model.remote(data)
  
      sum_d = Sum.bind()
      cm_d = ComposedModel.bind(sum_d)
      serve.run(cm_d)
  
      result = requests.get("http://127.0.0.1:8000/")
      assert result.status_code == 200
      assert float(result.text) == 100.0
  
imports: import asyncio
  import gc
  import sys
  import numpy
  import pytest
  import requests
  from fastapi import FastAPI
  from fastapi.responses import JSONResponse
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor
  from ray.serve.context import _get_global_client
  from ray.serve.handle import DeploymentHandle
label_desc: Use image node_id 3 for calling a global function with example usage: test_np_in_composed_model(serve_instance) and returns: np, unknown