@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 8c892b1831
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Doc] Fix UTF-8 encoding issues in documentation generation on Windows (#24361)

Signed-off-by: alekramelaheehridoy <aliqramalaheehridoy@gmail.com> Signed-off-by: alekramelaheehridoy <alekramelaheehridoy@gmail.com> Co-authored-by: alekramelaheehridoy <alekramelaheehridoy@gmail.com>

Al-Ekram Elahee Hridoy committed Sep 7, 2025 at 23:33 UTC 8c892b1831a8a35fbf5a89fedfaae0ab9bef2dd0
2 files changed +6 -3
docs/mkdocs/hooks/generate_argparse.py
+2 -1
@@ -165,6 +165,7 @@ def on_startup(command: Literal["build", "gh-deploy", "serve"], dirty: bool):
165 # Generate documentation for each parser
166 for stem, parser in parsers.items():
167 doc_path = ARGPARSE_DOC_DIR / f"{stem}.md"
168 - with open(doc_path, "w") as f:
168 + # Specify encoding for building on Windows
169 + with open(doc_path, "w", encoding="utf-8") as f:
170 f.write(parser.format_help())
171 logger.info("Argparse generated: %s", doc_path.relative_to(ROOT_DIR))
docs/mkdocs/hooks/generate_examples.py
+4 -2
@@ -106,7 +106,8 @@ class Example:
106
107 def determine_title(self) -> str:
108 if not self.is_code:
109 - with open(self.main_file) as f:
109 + # Specify encoding for building on Windows
110 + with open(self.main_file, encoding="utf-8") as f:
111 first_line = f.readline().strip()
112 match = re.match(r'^#\s+(?P<title>.+)$', first_line)
113 if match:
@@ -174,6 +175,7 @@ def on_startup(command: Literal["build", "gh-deploy", "serve"], dirty: bool):
175 doc_path = EXAMPLE_DOC_DIR / example.category / example_name
176 if not doc_path.parent.exists():
177 doc_path.parent.mkdir(parents=True)
177 - with open(doc_path, "w+") as f:
178 + # Specify encoding for building on Windows
179 + with open(doc_path, "w+", encoding="utf-8") as f:
180 f.write(example.generate())
181 logger.debug("Example generated: %s", doc_path.relative_to(ROOT_DIR))