Unverified Commit 26e1188e authored by zifeitong's avatar zifeitong Committed by GitHub
Browse files

[Fix] Use utf-8 encoding in entrypoints/openai/run_batch.py (#5606)

parent a3e8a05d
...@@ -58,7 +58,7 @@ async def read_file(path_or_url: str) -> str: ...@@ -58,7 +58,7 @@ async def read_file(path_or_url: str) -> str:
session.get(path_or_url) as resp: session.get(path_or_url) as resp:
return await resp.text() return await resp.text()
else: else:
with open(path_or_url, "r") as f: with open(path_or_url, "r", encoding="utf-8") as f:
return f.read() return f.read()
...@@ -71,7 +71,7 @@ async def write_file(path_or_url: str, data: str) -> None: ...@@ -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 # 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 # standalone program, blocking the event loop won't effect performance
# in this particular case. # 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) f.write(data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment