feat: Add Chat Completion API support to SharedPrefixDataGenerator#287
feat: Add Chat Completion API support to SharedPrefixDataGenerator#287bongwoobak wants to merge 6 commits intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bongwoobak The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @bongwoobak! |
|
/assign @Bslabe123 |
- Implement UserSessionChatAPIData for Chat API with multi-turn chat - Update SharedPrefixDataGenerator to support Chat API + Multi-turn combination - Fix prompt selection to use different questions for each turn - Initialize user session context as list for Chat API compatibility
2771d0c to
0f0012a
Compare
|
Sorry for the delay. I've updated the code to support multi-turn chat properly. |
|
should fix #303 |
| class LocalUserSession: | ||
| user_session_id: str | ||
| context: str | ||
| user_session_id: str |
There was a problem hiding this comment.
Duplicate user_session_id?
There was a problem hiding this comment.
Sorry for the mistake. Fixed it.
inference_perf/apis/user_session.py
Outdated
| user_session_id: str | ||
| context: str | ||
| user_session_id: str | ||
| context: Any |
There was a problem hiding this comment.
Is it possible to use a more precise type for context?
There was a problem hiding this comment.
Done. Changed from Any to list[ChatMessage] | str
|
Found a bug where group_id was incorrectly calculated after shuffle in multi-turn mode. Fixed the logic. ChangesBug Fixes:
Added:
|
|
#331 seems to also address shuffle. Let's revert this PR to the chat completion API support, and follow up the multi-turn shuffle PR with the tests you added in the later commit. Thanks! |
|
#332 - add unit test for shared prefix generator |
Also revert shuffle synchronization to match origin/main - only shuffle prompts list. Shuffle synchronization for prompt_pairs and user_sessions will be handled separately in PR kubernetes-sigs#331.
Summary
Extended SharedPrefixDataGenerator to support Chat Completion API alongside the existing Completion API.
Changes
Modified Files
inference_perf/datagen/shared_prefix_datagen.py