(buffer, path)
| 202 | log_stats = os.getenv("VLLM_LOG_STATS", "0") == "1" |
| 203 | |
| 204 | def flush_buffer(buffer, path): |
| 205 | if not buffer or not path: |
| 206 | return |
| 207 | with open(path, "a", encoding="utf-8") as f: |
| 208 | for row in buffer: |
| 209 | f.write(json.dumps(row, ensure_ascii=False) + "\n") |
| 210 | buffer.clear() |
| 211 | |
| 212 | with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor: |
| 213 | futures = [] |