MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / build_config_json

Function build_config_json

tests/layers/test_sampler.py:84–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83
84def build_config_json() -> str:
85 config_dict = {
86 "architectures": ["Qwen3MoeForCausalLM"],
87 "hidden_size": 7168,
88 "moe_intermediate_size": 1,
89 "moe_num_experts": 1,
90 "moe_k": 1,
91 "hidden_act": "silu",
92 "num_attention_heads": 64,
93 "dtype": "bfloat16",
94 }
95
96 tmp_dir = f"./tmpefef{paddle.distributed.get_rank()}"
97 os.makedirs(tmp_dir, exist_ok=True)
98 with open(f"./{tmp_dir}/config.json", "w") as f:
99 json.dump(config_dict, f)
100 model_name_or_path = os.path.join(os.getcwd(), tmp_dir)
101 print("model_name_or_path", model_name_or_path)
102 return model_name_or_path
103
104
105def get_fd_config(batch_size: int):

Callers 1

get_fd_configFunction · 0.70

Calls 4

printFunction · 0.85
get_rankMethod · 0.80
dumpMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected