Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for 01 model platform #1093

Merged
merged 9 commits into from
Oct 30, 2024
Merged

feat: Add support for 01 model platform #1093

merged 9 commits into from
Oct 30, 2024

Conversation

MuggleJinx
Copy link
Collaborator

Description

This PR adds support for the Yi-series LLM models, including yi-lightning, yi-large, yi-medium, and yi-large-turbo. The addition of Yi-series models enhances the platform’s capabilities, providing support for a broader range of language models and enabling users to leverage different performance tiers.

Motivation and Context

Closes issue #1066.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of example)

Implemented Tasks

  • Implement consistent interface for Yi-series model.
  • Add the corresponding example, and test file.

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.

@Wendong-Fan Wendong-Fan added Model Related to backend models New Feature labels Oct 20, 2024
@Wendong-Fan Wendong-Fan added this to the Sprint 14 milestone Oct 20, 2024
@Wendong-Fan Wendong-Fan linked an issue Oct 20, 2024 that may be closed by this pull request
2 tasks
@Wendong-Fan Wendong-Fan modified the milestones: Sprint 14, Sprint 2, Sprint 15 Oct 20, 2024
Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

thanks @MuggleJinx 's contribution! Left some comments below

Comment on lines 51 to 67
stop (Union[str, Sequence[str], NotGiven], optional): Up to `4`
sequences where the API will stop generating further tokens.
(default: :obj:`NOT_GIVEN`)
presence_penalty (float, optional): Number between :obj:`-2.0` and
:obj:`2.0`. Positive values penalize new tokens based on whether
they appear in the text so far, increasing the model's likelihood
to talk about new topics. (default: :obj:`0.0`)
frequency_penalty (float, optional): Number between :obj:`-2.0` and
:obj:`2.0`. Positive values penalize new tokens based on their
existing frequency in the text so far, decreasing the model's
likelihood to repeat the same line verbatim. (default: :obj:`0.0`)
logit_bias (dict, optional): Modify the likelihood of specified tokens
appearing in the completion. Accepts a json object that maps tokens
(specified by their token ID in the tokenizer) to an associated
bias value from :obj:`-100` to :obj:`100`. (default: :obj:`{}`)
user (str, optional): A unique identifier representing your end-user,
which can help monitor and detect abuse. (default: :obj:`""`)
Copy link
Member

@Wendong-Fan Wendong-Fan Oct 26, 2024

Choose a reason for hiding this comment

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

from yi's doc, I didn't see they mentioned they support these arguments and I think they are not supported yet

camel/types/enums.py Show resolved Hide resolved
model_type (UnifiedModelType): Model type for which tokens will be
counted.
"""
self._internal_tokenizer = OpenAITokenCounter(model_type)
Copy link
Member

Choose a reason for hiding this comment

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

how could Yi's model_type used by OpenAITokenCounter?

@Wendong-Fan Wendong-Fan merged commit aac3fa2 into master Oct 30, 2024
6 checks passed
@Wendong-Fan Wendong-Fan deleted the add_yi_model branch October 30, 2024 17:28
Comment on lines +112 to +113
elif model_platform.is_yi and model_type.is_yi:
model_class = YiModel
Copy link
Member

Choose a reason for hiding this comment

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

Would be better to move this above the ModelType.STUB.

Copy link
Member

@lightaime lightaime left a comment

Choose a reason for hiding this comment

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

Thanks @MuggleJinx!! That's awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Model Related to backend models New Feature
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add 01 model platform
3 participants