Skip to content

Commit

Permalink
[Fix] Use utf-8 encoding in entrypoints/openai/run_batch.py (vllm-pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeitong authored Jun 17, 2024
1 parent e2bce16 commit a749bcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/entrypoints/openai/run_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def read_file(path_or_url: str) -> str:
session.get(path_or_url) as resp:
return await resp.text()
else:
with open(path_or_url, "r") as f:
with open(path_or_url, "r", encoding="utf-8") as f:
return f.read()


Expand All @@ -71,7 +71,7 @@ async def write_file(path_or_url: str, data: str) -> None:
# We should make this async, but as long as this is always run as a
# standalone program, blocking the event loop won't effect performance
# in this particular case.
with open(path_or_url, "w") as f:
with open(path_or_url, "w", encoding="utf-8") as f:
f.write(data)


Expand Down

0 comments on commit a749bcb

Please sign in to comment.