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

Fixed leading white space stripping and added new options to iOS LlmInference #5635

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

priankakariatyml
Copy link
Collaborator

@priankakariatyml priankakariatyml commented Sep 19, 2024

  1. Fixed leading whitespace by stripping only leading white spaces from first non empty response.
    Previous implementation was stripping whitespaces from both ends only for the first response irrespective of whether empty/non-empty.

  2. Added new options


llmSessionRunner.predictAsync(
progress: { partialResponseStrings, error in
guard let responseStrings = partialResponseStrings,
let humanReadableLlmResponse = Session.humanReadableString(
llmResponses: responseStrings, stripLeadingWhitespaces: receivedFirstToken)
llmResponses: responseStrings, stripLeadingWhitespaces: !receivedFirstNonEmptyToken)
else {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yishuangP I have changed the name of the state variable and the values it takes in different scenarios to map closely to the meaning of the variable name for better readability. So the condition check for leading white space stripping is flipped. The logic remains the same as the previous implementation.

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