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

Refactor chat_generate #171

Merged
merged 2 commits into from
Jul 22, 2023
Merged

Refactor chat_generate #171

merged 2 commits into from
Jul 22, 2023

Conversation

zhaochenyang20
Copy link
Contributor

@zhaochenyang20 zhaochenyang20 commented Jul 22, 2023

Description

  1. I create ERROR_ERRORS_TO_MESSAGES to make the error handling clearer for _throttled_openai_completion_acreate and _throttled_openai_chat_completion_acreate.
  2. There is no TimeoutError in openai.error, so I delete it.
  3. I add a new parameter n for both completion, which is the number of responses to generate for each API call.

References

Blocked by

  • This one works fine. Sorry for the previous one. I don't know why it's so strange.

@zhaochenyang20
Copy link
Contributor Author

zhaochenyang20 commented Jul 22, 2023

Hey @neubig and @cabreraalex, sorry for creating this one and discarding the previous PR. I failed several times for the pre-commit of #170, then I uninstall all the environments for my local Python 3.11.3, use 3.9.17, delete the previous fork, and create a new one. It seems to work out. 🤔

The way to fix this is really strange. Delete, re-install, and re-run them all. 😂 I spent a long time searching for help from StackOverflow and so on...

@zhaochenyang20
Copy link
Contributor Author

Thanks so much for your help and advise for this PR and issue #169!

Copy link
Collaborator

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Thanks @zhaochenyang20 , this looks great! There is just one small change request. I used Github's suggestion functionality, so you should just be able to click "accept suggestion".

And sorry about the trouble with the isort stuff, I'm not sure what was causing that

zeno_build/models/providers/openai_utils.py Outdated Show resolved Hide resolved
Co-authored-by: Graham Neubig <[email protected]>
@zhaochenyang20
Copy link
Contributor Author

Thanks @zhaochenyang20 , this looks great! There is just one small change request. I used Github's suggestion functionality, so you should just be able to click "accept suggestion".

And sorry about the trouble with the isort stuff, I'm not sure what was causing that

Done! The other part is just fine. I don't know what causes this strange behavior of isort either. 🤷🏻‍♀️

@neubig neubig merged commit 31c4cbe into zeno-ml:main Jul 22, 2023
7 checks passed
@neubig
Copy link
Collaborator

neubig commented Jul 22, 2023

Great, merged. Thanks for the contribution!

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.

3 participants