code: def test_custom_tokenizer():
      from flash.core.serve.types import Text
  
      tokenizer = CustomTokenizer("test")
      text = Text(tokenizer=tokenizer)
      assert text.deserialize("random string") == "encoding from test"
      assert (
          text.serialize(torch.tensor([[1, 2]])) == "decoding from test"
      )
  
file_path: lightning-flash/tests/core/serve/test_types/test_text.py
imports: from dataclasses import dataclass
  import pytest
  import torch
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 1 for calling a global function with example usage: test_custom_tokenizer() without return types