Skip to content

Commit

Permalink
fix: anyio -> aiofiles
Browse files Browse the repository at this point in the history
  • Loading branch information
miri-bar committed Jun 16, 2024
1 parent a594d26 commit db4c4e4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 37 deletions.
5 changes: 3 additions & 2 deletions ai21_tokenizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import json
from pathlib import Path
from typing import Any, Dict, Union, Optional, BinaryIO
from anyio import open_file

import aiofiles

_NUMBER_DIGITS = set("0123456789")
PathLike = Union[Path, str]
Expand All @@ -29,7 +30,7 @@ def load_binary(file_path: PathLike) -> bytes:
async def aload_binary(file_path: PathLike) -> bytes:
# file_path = _str_to_path(file_path)

async with await open_file(file_path, "rb") as f:
async with await aiofiles.open(file_path, "rb") as f:
return await f.read()


Expand Down
46 changes: 12 additions & 34 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ packages = [
python = "^3.7"
sentencepiece = ">=0.2.0,<1.0.0"
tokenizers = ">=0.15.0,<1.0.0"
anyio = "3.7.1"
aiofiles = "^23.2"

[tool.poetry.group.dev.dependencies]
black = "*"
Expand Down Expand Up @@ -108,6 +108,8 @@ newline_sequence = "\n"





[tool.poetry.group.test.dependencies]
coverage = "^7.1.0"
pytest = "7.4.4"
Expand Down

0 comments on commit db4c4e4

Please sign in to comment.