code: def test_composition_from_url_torchscript_servable(tmp_path):
      from flash.core.serve import ModelComponent, Servable, expose
      from flash.core.serve.types import Number
  
      """
      # Tensor x Tensor
      class MyModule(nn.Module):
          def __init__(self):
              super(MyModule, self).__init__()
  
          def forward(self, a, b):
              result_0 = a / b
              result_1 = torch.div(a, b)
              result_2 = a.div(b)
  
              return result_0, result_1, result_2
  
      TorchScript (.pt) can be downloaded at TORCHSCRIPT_DOWNLOAD_URL
      """
      TORCHSCRIPT_DOWNLOAD_URL = "https://github.com/pytorch/pytorch/raw/95489b590f00801bdee7f41783f30874883cf6bb/test/jit/fixtures/test_versioned_div_tensor_inplace_v3.pt"  # noqa E501
  
      class ComponentTwoModels(ModelComponent):
          def __init__(self, model):
              self.encoder = model["encoder"]
              self.decoder = model["decoder"]
  
          @expose(
              inputs={"inp": Number()}, outputs={"output": Number()}
          )
          def do_my_predict(self, inp):
              """My predict docstring."""
              return self.decoder(self.encoder(inp, inp), inp)
  
      gm = Servable(
          TORCHSCRIPT_DOWNLOAD_URL,
          download_path=tmp_path / "tmp_download.pt",
      )
  
      c_1 = ComponentTwoModels({"encoder": gm, "decoder": gm})
      c_2 = ComponentTwoModels({"encoder": gm, "decoder": gm})
  
      c_1.outputs.output >> c_2.inputs.inp
  
      ep = Endpoint(
          route="/predictr",
          inputs={"ep_in": c_1.inputs.inp},
          outputs={"ep_out": c_1.outputs.output},
      )
  
      composit = Composition(
          c_1=c_1, c_2=c_2, endpoints=ep, TESTING=True, DEBUG=True
      )
      app = composit.serve(host="0.0.0.0", port=8000)
      with TestClient(app) as tc:
          body = {
              "session": "UUID",
              "payload": {
                  "ep_in": {"num": 10},
              },
          }
          success = tc.post("http://127.0.0.1:8000/predictr", json=body)
          assert success.json() == {
              "result": {"ep_out": 1.0},
              "session": "UUID",
          }
  
file_path: lightning-flash/tests/core/serve/test_integration.py
imports: import base64
  import pytest
  from flash.core.serve import Composition, Endpoint
  from flash.core.utilities.imports import _FASTAPI_AVAILABLE, _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 8 for calling a global function with example usage: test_composition_from_url_torchscript_servable(tmp_path) and returns: self