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

bugfix(Azure): fix index out of range error due to Azure Openai reponses an empty chunk at first #820

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

zfanswer
Copy link
Contributor

Description

image

Azure Openai reponse may have an empty chunk at the first streming response, i.e. the "choices" key have an empty list.
This will cause the error from reponse json parser.

You can see the "choices": [] at the first response.
image

Solution

Do a empty/None check before parse the response json.

fangyinc
fangyinc previously approved these changes Nov 22, 2023
Copy link
Collaborator

@fangyinc fangyinc left a comment

Choose a reason for hiding this comment

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

LGTM.

@fangyinc
Copy link
Collaborator

Hi, @zfanswer, thank you for your PR. Please address the code formatting issues. You can install black with pip install black, and then run black . in the project directory to format the Python code.

@zfanswer
Copy link
Contributor Author

Hi, @zfanswer, thank you for your PR. Please address the code formatting issues. You can install black with pip install black, and then run black . in the project directory to format the Python code.

didn't get the notice,...
black . is done.

@fangyinc fangyinc added model Module: model fix Bug fixes and removed Waiting for reply labels Nov 28, 2023
Copy link
Collaborator

@fangyinc fangyinc left a comment

Choose a reason for hiding this comment

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

LGTM.

@fangyinc fangyinc merged commit 0b02451 into eosphoros-ai:main Nov 28, 2023
3 checks passed
@zfanswer zfanswer deleted the develop branch December 5, 2023 07:58
Hopshine pushed a commit to Hopshine/DB-GPT that referenced this pull request Sep 10, 2024
…ses an empty chunk at first (eosphoros-ai#820)

Co-authored-by: 一帆 <zhang.f@digitalcnzz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes model Module: model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants