Merged
Conversation
Contributor
There was a problem hiding this comment.
❌ Changes requested.
- Reviewed the entire pull request up to 4bd3e9f
- Looked at
167lines of code in3files - Took 1 minute and 26 seconds to review
More info
- Skipped
2files when reviewing. - Skipped posting
1additional comments because they didn't meet confidence threshold of50%.
1. continuous_eval/generators/simple.py:13:
- Assessed confidence :
80% - Grade:
0% - Comment:
Thelogging.basicConfigshould be called only once in the main function and not in a module. This is because thebasicConfigdoes nothing if the root logger already has handlers configured for it. It's also not clear why the logging level is set to WARNING. Consider removing this line or moving it to the main function. - Reasoning:
The PR adds support for the Cohere language model in the LLMFactory class. It also adds a progress bar to the SimpleDatasetGenerator's generate method. The changes seem to be correctly implemented. However, there's a minor issue in the logging setup. The logging.basicConfig should be called only once in the main function and not in a module. This is because the basicConfig does nothing if the root logger already has handlers configured for it. It's also not clear why the logging level is set to WARNING.
Workflow ID: wflow_5afwPDW8eG3UJ9f9
Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.
| response = self.client.generate(model="command", prompt=prompt, temperature=temperature, max_tokens=1024) # type: ignore | ||
| try: | ||
| content = response.generations[0].text | ||
| except: |
Contributor
There was a problem hiding this comment.
Consider raising an exception instead of returning an empty string when an error occurs in generating content from Cohere. This would allow the calling code to decide how to handle the error. For example:
Suggested change
| except: | |
| except Exception as e: | |
| raise RuntimeError(f'Failed to generate content from Cohere: {e}') |
Contributor
|
Looks great! |
yisz
approved these changes
Mar 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This PR integrates the Cohere language model into the
LLMFactoryclass, adds a progress bar to thegeneratefunction inSimpleDatasetGenerator, and includes a test for the Cohere model.Key points:
LLMFactoryclass.generatefunction inSimpleDatasetGenerator.llm_factory_test.py.Generated with ❤️ by ellipsis.dev