code: def create_api(
      model: Callable,
      api_type: str = "IMAGE-CLASSIFICATION",
      preprocess_fn: Callable = None,
      preprocess_conf: Optional[Dict] = None,
      postprocess_fn: Callable = None,
      postprocess_conf: Optional[Dict] = None,
      run: bool = False,
      **kwargs,
  ) -> API:
      """
      Launch FastAPI app
      Args:
          model: Any ML/DL model
          api_type: Type of the API task, see `chitra.serve.get_available_api_types()`
          preprocess_fn: Override default preprocessing function
          preprocess_conf: Arguments for preprocessing function
          postprocess_fn: Override default postprocessing function
          postprocess_conf: Arguments for postprocessing function
          run: Set True to run the app
          **kwargs:
  
      Returns:
          Object of `chitra.serve.API` class
      """
      api = API(
          api_type,
          model,
          preprocess_fn=preprocess_fn,
          preprocess_conf=preprocess_conf,
          postprocess_fn=postprocess_fn,
          postprocess_conf=postprocess_conf,
          **kwargs,
      )
  
      if run:
          api.run()
      return api
  
file_path: chitra/chitra/serve/api.py
imports: from typing import Callable, Dict, Optional
  import uvicorn
  from fastapi import FastAPI, File, UploadFile
  from chitra.__about__ import documentation_url
  from chitra.serve import schema
  from chitra.serve.base import ModelServer
  from chitra.serve.constants import IMAGE_CLF, OBJECT_DETECTION, QNA, TXT_CLF
label_desc: Use image node_id 1 for calling a global function with example usage: create_api(model, api_type, preprocess_fn, preprocess_conf, postprocess_fn, postprocess_conf, run) and returns: api