code: def gr_to_lg(
      image_audio_loaders,
      pdf_loaders,
      url_loaders,
      use_pymupdf=None,
      use_unstructured_pdf=None,
      use_pypdf=None,
      enable_pdf_ocr=None,
      enable_pdf_doctr=None,
      try_pdf_as_html=None,
      **kwargs,
  ):
      assert use_pymupdf is not None
      assert use_unstructured_pdf is not None
      assert use_pypdf is not None
      assert enable_pdf_ocr is not None
      assert enable_pdf_doctr is not None
      assert try_pdf_as_html is not None
  
      if image_audio_loaders is None:
          image_audio_loaders = kwargs["image_audio_loaders_options0"]
      if pdf_loaders is None:
          pdf_loaders = kwargs["pdf_loaders_options0"]
      if url_loaders is None:
          url_loaders = kwargs["url_loaders_options0"]
      # translate:
      # 'auto' wouldn't be used here
      ret = dict(
          # urls
          use_unstructured="Unstructured" in url_loaders,
          use_playwright="PlayWright" in url_loaders,
          use_selenium="Selenium" in url_loaders,
          use_scrapeplaywright="ScrapeWithPlayWright" in url_loaders,
          use_scrapehttp="ScrapeWithHttp" in url_loaders,
          # pdfs
          # ... else condition uses default from command line, by default auto, so others can be used as backup
          # make sure pass 'off' for those if really want fully disabled.
          use_pymupdf="on" if "PyMuPDF" in pdf_loaders else use_pymupdf,
          use_unstructured_pdf="on"
          if "Unstructured" in pdf_loaders
          else use_unstructured_pdf,
          use_pypdf="on" if "PyPDF" in pdf_loaders else use_pypdf,
          enable_pdf_ocr="on"
          if "OCR" in pdf_loaders
          else enable_pdf_ocr,
          enable_pdf_doctr="on"
          if "DocTR" in pdf_loaders
          else enable_pdf_doctr,
          try_pdf_as_html="on"
          if "TryHTML" in pdf_loaders
          else try_pdf_as_html,
          # images and audio
          enable_ocr="OCR" in image_audio_loaders,
          enable_doctr="DocTR" in image_audio_loaders,
          enable_pix2struct="Pix2Struct" in image_audio_loaders,
          enable_captions="Caption" in image_audio_loaders
          or "CaptionBlip2" in image_audio_loaders,
          enable_transcriptions="ASR" in image_audio_loaders
          or "ASRLarge" in image_audio_loaders,
          enable_llava="LLaVa" in image_audio_loaders,
      )
      if "CaptionBlip2" in image_audio_loaders:
          # just override, don't actually do both even if user chose both
          captions_model = "Salesforce/blip2-flan-t5-xl"
      else:
          captions_model = kwargs["captions_model"]
      if "ASRLarge" in image_audio_loaders:
          # just override, don't actually do both even if user chose both
          asr_model = "openai/whisper-large-v3"
      else:
          asr_model = kwargs["asr_model"]
      return ret, captions_model, asr_model
  
file_path: h2ogpt/src/enums.py
imports: from enum import Enum
label_desc: Use image node_id 5 for calling a global function with example usage: gr_to_lg(image_audio_loaders, pdf_loaders, url_loaders, use_pymupdf, use_unstructured_pdf, use_pypdf, enable_pdf_ocr, enable_pdf_doctr, try_pdf_as_html) and returns: ret,  captions_model,  asr_model