Fix chat template cache key order (#41517)
This commit is contained in:
@@ -1748,6 +1748,7 @@ class OpenAIServingChat(OpenAIServingBase):
|
||||
cache_key = None
|
||||
if use_cache:
|
||||
try:
|
||||
# Key order is part of the key: templates render dicts in their given order.
|
||||
cache_key = orjson.dumps(
|
||||
(
|
||||
getattr(
|
||||
@@ -1760,7 +1761,6 @@ class OpenAIServingChat(OpenAIServingBase):
|
||||
template_kwargs,
|
||||
encode_kwargs,
|
||||
),
|
||||
option=orjson.OPT_SORT_KEYS,
|
||||
)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user