Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten committed Sep 18, 2024
1 parent 632db44 commit 5ee6372
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/mistral_common/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from mistral_common import __version__


def download_image(url: str) -> Image.Image:
headers = {"User-Agent": f"mistral-common/{__version__}"}
try:
Expand Down
9 changes: 3 additions & 6 deletions src/mistral_common/tokens/tokenizers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ def __call__(self, content: Union[ImageChunk, ImageURLChunk]) -> ImageEncoding:
...

@property
def image_token(self) -> int:
...
def image_token(self) -> int: ...


class InstructTokenizer(Generic[InstructRequestType, FIMRequestType, TokenizedType, AssistantMessageType]):
Expand Down Expand Up @@ -182,8 +181,7 @@ def encode_user_message(
is_first: bool,
system_prompt: Optional[str] = None,
force_img_first: bool = False,
) -> Tuple[List[int], List[np.ndarray]]:
...
) -> Tuple[List[int], List[np.ndarray]]: ...

@abstractmethod
def encode_user_content(
Expand All @@ -192,5 +190,4 @@ def encode_user_content(
is_last: bool,
system_prompt: Optional[str] = None,
force_img_first: bool = False,
) -> Tuple[List[int], List[np.ndarray]]:
...
) -> Tuple[List[int], List[np.ndarray]]: ...

0 comments on commit 5ee6372

Please sign in to comment.