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

Function load_data

tests/ce/performance/stress_tools.py:24–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23# ============ 数据加载 ============
24async def load_data():
25 data = []
26 with open(DATA_FILE, "r", encoding="utf-8") as f:
27 for line in f:
28 try:
29 obj = json.loads(line)
30 # RL 要求
31 data.append(obj["src"][0] if "src" in obj else obj.get("content", line.strip()))
32 except json.JSONDecodeError:
33 data.append(line.strip())
34 if not data:
35 raise ValueError(f"{DATA_FILE} 为空或格式不正确")
36 return data
37
38
39# ============ 请求发送 ============

Callers 1

run_load_testFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected