Get the number of redundancy experts from the environment variable. :return: Number of redundancy experts.
()
| 111 | |
| 112 | @lru_cache(maxsize=None) |
| 113 | def get_redundancy_expert_num(): |
| 114 | """ |
| 115 | Get the number of redundancy experts from the environment variable. |
| 116 | :return: Number of redundancy experts. |
| 117 | """ |
| 118 | args = get_env_start_args() |
| 119 | if args.ep_redundancy_expert_config_path is None: |
| 120 | return 0 |
| 121 | |
| 122 | with open(args.ep_redundancy_expert_config_path, "r") as f: |
| 123 | config = json.load(f) |
| 124 | if "redundancy_expert_num" in config: |
| 125 | return config["redundancy_expert_num"] |
| 126 | else: |
| 127 | return 0 |
| 128 | |
| 129 | |
| 130 | @lru_cache(maxsize=None) |
no test coverage detected