code: def refinement_phase(
      u: int, k_models: List, dataset_name: str, config_file: str
  ):
      """
      U: training-epoches
      K-Models: k models to train
      config_file: config file path
      """
      args = parse_config_arguments(config_file)
      args.device = "cuda:7"
      train_dataloader = StreamingDataLoader(
          cache_svc_url=args.cache_svc_url,
          table_name=f"{dataset_name}_train",
          name_space="train",
      )
      eval_dataloader = StreamingDataLoader(
          cache_svc_url=args.cache_svc_url,
          table_name=f"{dataset_name}_valid",
          name_space="valid",
      )
  
      try:
          rms = RunModelSelection(
              args.search_space, args, is_simulate=args.is_simulate
          )
          best_arch, best_arch_performance, _ = rms.refinement_phase(
              U=u,
              k_models=k_models,
              train_loader=train_dataloader,
              valid_loader=eval_dataloader,
          )
      finally:
          train_dataloader.stop()
          eval_dataloader.stop()
      return {
          "best_arch": best_arch,
          "best_arch_performance": best_arch_performance,
      }
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/eva_service.py
imports: import calendar
  import os
  import time
  import argparse
  import configparser
  from sanic import Sanic
  from sanic.exceptions import InvalidUsage
  from sanic.response import json
  from src.logger import logger
  from src.eva_engine.run_ms import RunModelSelection
  from src.dataset_utils.stream_dataloader import StreamingDataLoader
  from shared_config import parse_config_arguments
  from typing import Any, List, Dict, Tuple
label_desc: Use image node_id 1 for calling a global function with example usage: refinement_phase(u, k_models, dataset_name, config_file) and returns: dict