class_docstr: Flask Combo Retrieval server, which helps to aggregate different retrieval services
code: def __init__(
      self,
      tokenizer: TokenizerSpec,
      services_cfg: list,
  ):
      self.app = Flask(__name__, static_url_path="")
      services = []
      weights = []
      for service_cfg in services_cfg:
          weights.append(service_cfg.weight)
          if service_cfg.type == "FaissRetrievalService":
              service = FaissRetrievalService(
                  tokenizer=tokenizer,
                  service_ip=service_cfg.service_ip,
                  service_port=service_cfg.service_port,
              )
          elif service_cfg.type == "DynamicFaissRetrievalService":
              service = DynamicFaissRetrievalService(
                  tokenizer=tokenizer,
                  service_ip=service_cfg.service_ip,
                  service_port=service_cfg.service_port,
              )
          else:
              raise ValueError(
                  f"Unsupported retrieval service {service_cfg.type}"
              )
          services.append(service)
      self.weight_container = [weights]
      self.tokenizer = tokenizer
  
      api = Api(self.app)
      api.add_resource(
          ComboRetrievalResource,
          "/knn",
          resource_class_args=[
              services,
              self.weight_container,
          ],
      )
  
imports: import pickle
  import threading
  from typing import List, Union
  import faiss
  import numpy
  import torch
  from flask import Flask, jsonify, request
  from flask_restful import Api, Resource
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.modules.common.megatron.retrieval_services.retrieval_service import DynamicFaissRetrievalService, FaissRetrievalService
  from nemo.collections.nlp.modules.common.megatron.retrieval_services.util import lock
label_desc: Use image node_id 1 to create a new ComboRetrievalServer object from inherited base classes: object with example: obj = ComboRetrievalServer(tokenizer, services_cfg)