diff --git a/docs/tools/fix_grammar_gpt.py b/docs/tools/fix_grammar_gpt.py index 43b4b32ce2..8affb9e1c4 100644 --- a/docs/tools/fix_grammar_gpt.py +++ b/docs/tools/fix_grammar_gpt.py @@ -109,7 +109,7 @@ def get_chunk_length(chunk: List[str]) -> int: fmt.note(f"Created {len(chunks)} chunks") - fixed_chunks: List[List[str]] = [] + fixed_chunks: List[str] = [] for chunk in chunks: client = OpenAI() response = client.chat.completions.create( @@ -125,8 +125,9 @@ def get_chunk_length(chunk: List[str]) -> int: with open(file_path, "w", encoding="utf-8") as f: for c in fixed_chunks: - f.writelines(c) - f.writelines([""] * 2) + f.write(c) + f.write("\n") + f.write("\n") if count == 0: fmt.warning("No files selected for grammar check.")