Skip to content

Commit

Permalink
Fix type hints for apply_chat_template (#35216)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 authored Dec 12, 2024
1 parent 3db8e27 commit 5cf11e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/tokenization_utils_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from contextlib import contextmanager
from dataclasses import dataclass
from inspect import isfunction
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union
from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union

import numpy as np
from packaging import version
Expand Down Expand Up @@ -1527,7 +1527,7 @@ def get_vocab(self) -> Dict[str, int]:
def apply_chat_template(
self,
conversation: Union[List[Dict[str, str]], List[List[Dict[str, str]]]],
tools: Optional[List[Dict]] = None,
tools: Optional[List[Union[Dict, Callable]]] = None,
documents: Optional[List[Dict[str, str]]] = None,
chat_template: Optional[str] = None,
add_generation_prompt: bool = False,
Expand Down

0 comments on commit 5cf11e5

Please sign in to comment.