code: def run_h2ogpt_docker(
      port, base_model, inference_server=None, max_new_tokens=None
  ):
      os.system("docker pull gcr.io/vorvan/h2oai/h2ogpt-runtime:0.1.0")
      datetime_str = (
          str(datetime.now()).replace(" ", "_").replace(":", "_")
      )
      msg = "Starting h2oGPT %s..." % datetime_str
      print(msg, flush=True)
      home_dir = os.path.expanduser("~")
      makedirs(os.path.join(home_dir, ".cache/huggingface/hub"))
      makedirs(os.path.join(home_dir, "save"))
      cmd = (
          ["docker"]
          + [
              "run",
              "-d",
              "--runtime",
              "nvidia",
          ]
          + gpus_cmd()
          + [
              "--shm-size",
              "1g",
              "-p",
              "%s:7860" % port,
              "-v",
              "%s/.cache:/workspace/.cache/" % home_dir,
              "-v",
              "%s/save:/workspace/save" % home_dir,
              "-v",
              "/etc/passwd:/etc/passwd:ro",
              "-v",
              "/etc/group:/etc/group:ro",
              "-u",
              "%s:%s" % (os.getuid(), os.getgid()),
              "-e",
              "HUGGING_FACE_HUB_TOKEN=%s"
              % os.environ["HUGGING_FACE_HUB_TOKEN"],
              "--network",
              "host",
              "gcr.io/vorvan/h2oai/h2ogpt-runtime:0.1.0",
              # 'h2ogpt',  # use when built locally with vLLM just freshly added
              "/workspace/generate.py",
              "--base_model=%s" % base_model,
              "--use_safetensors=True",
              "--save_dir=/workspace/save/",
              "--score_model=None",
              "--max_max_new_tokens=%s" % (max_new_tokens or 2048),
              "--max_new_tokens=%s" % (max_new_tokens or 1024),
              "--num_async=10",
              "--num_beams=1",
              "--top_k_docs=-1",
              "--chat=True",
              "--stream_output=True",
              # '--debug=True',
          ]
      )
  
      if inference_server:
          cmd.extend(["--inference_server=%s" % inference_server])
  
      print(cmd, flush=True)
      docker_hash = subprocess.check_output(cmd).decode().strip()
      print("Done starting h2oGPT server: %s" % docker_hash, flush=True)
      return docker_hash
  
imports: import os
  import subprocess
  import time
  from datetime import datetime
  import pytest
  from src.utils import get_ngpus_vis, makedirs
  from tests.utils import wrap_test_forked, get_inf_port, get_inf_server
  from tests.test_langchain_units import have_openai_key, have_replicate_key
  from src.client_test import run_client_many, test_client_basic_api_lean
  from src.enums import PromptType, LangChainAction
label_desc: Use image node_id 5 for calling a global function with example usage: run_h2ogpt_docker(port, base_model, inference_server, max_new_tokens) and returns: docker_hash