Skip to content

Commit

Permalink
Fix NoneType type as it requires py>=3.10 (#35843)
Browse files Browse the repository at this point in the history
fix type
  • Loading branch information
SunMarc authored Jan 22, 2025
1 parent fdcc62c commit 2c3a44f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/utils/chat_template_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from contextlib import contextmanager
from datetime import datetime
from functools import lru_cache
from types import NoneType
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, get_args, get_origin, get_type_hints

from packaging import version
Expand Down Expand Up @@ -78,7 +77,7 @@ def _get_json_schema_type(param_type: str) -> Dict[str, str]:
float: {"type": "number"},
str: {"type": "string"},
bool: {"type": "boolean"},
NoneType: {"type": "null"},
type(None): {"type": "null"},
Any: {},
}
if is_vision_available():
Expand Down

0 comments on commit 2c3a44f

Please sign in to comment.