MCPcopy
hub / github.com/ModelTC/LightLLM / get_redundancy_expert_num

Function get_redundancy_expert_num

lightllm/utils/envs_utils.py:113–127  ·  view source on GitHub ↗

Get the number of redundancy experts from the environment variable. :return: Number of redundancy experts.

()

Source from the content-addressed store, hash-verified

111
112@lru_cache(maxsize=None)
113def 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)

Callers 3

new_deepep_groupMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls 2

get_env_start_argsFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected