Skip to content

Fix o1 support#31

Merged
ammirsm merged 4 commits intomainfrom
fix-o1-support
Nov 22, 2024
Merged

Fix o1 support#31
ammirsm merged 4 commits intomainfrom
fix-o1-support

Conversation

@ammirsm
Copy link
Copy Markdown
Contributor

@ammirsm ammirsm commented Nov 22, 2024

This pull request includes updates to the zenbase project, focusing on version updates, optimization of language model functions, and cleanup of test files.

Version update:

Optimization of language model functions:

  • py/src/zenbase/predefined/generic_lm_function/optimizer.py: Introduced a system_role variable to dynamically set the role based on the model prefix and refactored message creation logic in multiple functions to use this variable. Additionally, optimized the creation of kwargs for the chat.completions.create method by conditionally adding logprobs and top_logprobs only when the model does not start with "o1". [1] [2] [3]

Cleanup of test files:

…nOptimizer

- Define `system_role` based on model type for user prompts.
- Include contextual messages before user inputs to improve interaction flow.
- Update kwargs for completion creation to include necessary parameters conditionally.
Copy link
Copy Markdown
Contributor Author

@ammirsm ammirsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ammirsm ammirsm self-assigned this Nov 22, 2024
@CyrusNuevoDia CyrusNuevoDia self-requested a review November 22, 2024 20:11
Copy link
Copy Markdown
Contributor

@CyrusNuevoDia CyrusNuevoDia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ammirsm ammirsm merged commit d276f78 into main Nov 22, 2024
@ammirsm ammirsm deleted the fix-o1-support branch November 22, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants