File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1342,6 +1342,14 @@ class EmbeddingChatRequest(OpenAIBaseModel):
1342
1342
truncate_prompt_tokens : Optional [Annotated [int , Field (ge = - 1 )]] = None
1343
1343
1344
1344
# --8<-- [start:chat-embedding-extra-params]
1345
+ add_generation_prompt : bool = Field (
1346
+ default = False ,
1347
+ description =
1348
+ ("If true, the generation prompt will be added to the chat template. "
1349
+ "This is a parameter used by chat template in tokenizer config of the "
1350
+ "model." ),
1351
+ )
1352
+
1345
1353
add_special_tokens : bool = Field (
1346
1354
default = False ,
1347
1355
description = (
Original file line number Diff line number Diff line change @@ -93,9 +93,7 @@ async def _preprocess(
93
93
or ctx .chat_template ,
94
94
chat_template_content_format = ctx .
95
95
chat_template_content_format ,
96
- # In embedding requests, we are not generating tokens,
97
- # so there is no need to append extra tokens to the input
98
- add_generation_prompt = False ,
96
+ add_generation_prompt = ctx .request .add_generation_prompt ,
99
97
continue_final_message = False ,
100
98
add_special_tokens = ctx .request .add_special_tokens ,
101
99
)
You can’t perform that action at this time.
0 commit comments