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

Function write_local_file

fastdeploy/entrypoints/openai/run_batch.py:170–180  ·  view source on GitHub ↗

Write the responses to a local file. output_path: The path to write the responses to. batch_outputs: The list of batch outputs to write.

(output_path: str, batch_outputs: list[BatchRequestOutput])

Source from the content-addressed store, hash-verified

168
169
170async def write_local_file(output_path: str, batch_outputs: list[BatchRequestOutput]) -> None:
171 """
172 Write the responses to a local file.
173 output_path: The path to write the responses to.
174 batch_outputs: The list of batch outputs to write.
175 """
176 # We should make this async, but as long as run_batch runs as a
177 # standalone program, blocking the event loop won't effect performance.
178 with open(output_path, "w", encoding="utf-8") as f:
179 for o in batch_outputs:
180 print(o.model_dump_json(), file=f)
181
182
183async def upload_data(output_url: str, data_or_file: str, from_file: bool) -> None:

Callers 3

run_testMethod · 0.90
test_write_local_fileMethod · 0.90
write_fileFunction · 0.85

Calls 1

printFunction · 0.85

Tested by 2

run_testMethod · 0.72
test_write_local_fileMethod · 0.72