Skip to content

Commit 7f6835e

Browse files
committed
load.read_file: do not use blobfile for local files
1 parent 2ab6d37 commit 7f6835e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tiktoken/load.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77

88
def read_file(blobpath: str) -> bytes:
9+
if os.path.exists(blobpath):
10+
with open(blobpath, "rb") as f:
11+
return f.read()
12+
913
if not blobpath.startswith("http://") and not blobpath.startswith("https://"):
1014
try:
1115
import blobfile

0 commit comments

Comments
 (0)