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

watson_models #1069

Merged
merged 1 commit into from
Jul 29, 2024
Merged

watson_models #1069

merged 1 commit into from
Jul 29, 2024

Conversation

mrT23
Copy link
Collaborator

@mrT23 mrT23 commented Jul 29, 2024

PR Type

enhancement


Description

  • Added new watsonx models to the token limit dictionary in __init__.py.
  • Included models such as meta-llama, ibm/granite, and mistralai with their respective token limits.

Changes walkthrough 📝

Relevant files
Enhancement
__init__.py
Add new `watsonx` models to token limit dictionary             

pr_agent/algo/init.py

  • Added new model entries to the dictionary.
  • Included various watsonx models with specific token limits.
  • +6/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link
    Contributor

    codiumai-pr-agent-pro bot commented Jul 29, 2024

    PR Reviewer Guide 🔍

    (Review updated until commit f50832e)

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🏅 Score: 95
    🧪 No relevant tests
    🔒 No security concerns identified
    🔀 No multiple PR themes
    ⚡ No key issues to review

    @mrT23 mrT23 mentioned this pull request Jul 29, 2024
    @mrT23 mrT23 merged commit 41588ef into main Jul 29, 2024
    1 check passed
    @mrT23 mrT23 deleted the watson_models branch July 29, 2024 05:39
    @mrT23
    Copy link
    Collaborator Author

    mrT23 commented Aug 1, 2024

    /improve_code

    Copy link
    Contributor

    codiumai-pr-agent-pro bot commented Aug 1, 2024

    PR Code Suggestions ✨

    Latest suggestions up to f50832e

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Standardize string delimiters to improve code consistency

    Ensure consistent use of single or double quotes for string literals to maintain
    code consistency and readability.

    pr_agent/algo/init.py [55-60]

    -'watsonx/meta-llama/llama-3-8b-instruct': 4096,
    +"watsonx/meta-llama/llama-3-8b-instruct": 4096,
     "watsonx/meta-llama/llama-3-70b-instruct": 4096,
     "watsonx/meta-llama/llama-3-405b-instruct": 16384,
     "watsonx/ibm/granite-13b-chat-v2": 8191,
     "watsonx/ibm/granite-34b-code-instruct": 8191,
     "watsonx/mistralai/mistral-large": 32768,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Ensuring consistent use of single or double quotes for string literals improves code readability and maintainability. This suggestion correctly identifies and addresses the inconsistency in the use of quotes.

    8
    Reorder dictionary keys to improve the logical grouping and readability

    Ensure that the dictionary keys are sorted or grouped logically to enhance
    readability and maintainability of the model configuration.

    pr_agent/algo/init.py [55-60]

    -'watsonx/meta-llama/llama-3-8b-instruct': 4096,
    +"watsonx/ibm/granite-13b-chat-v2": 8191,
    +"watsonx/ibm/granite-34b-code-instruct": 8191,
    +"watsonx/meta-llama/llama-3-8b-instruct": 4096,
     "watsonx/meta-llama/llama-3-70b-instruct": 4096,
     "watsonx/meta-llama/llama-3-405b-instruct": 16384,
    -"watsonx/ibm/granite-13b-chat-v2": 8191,
    -"watsonx/ibm/granite-34b-code-instruct": 8191,
     "watsonx/mistralai/mistral-large": 32768,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Reordering dictionary keys for better logical grouping and readability is a good practice for maintainability. This suggestion correctly identifies an improvement in the code structure.

    7
    Performance
    Adjust memory allocation values for consistency and potential performance improvement

    Consider using a more consistent and possibly higher memory allocation for
    'watsonx/ibm/granite-13b-chat-v2' and 'watsonx/ibm/granite-34b-code-instruct' to
    align with other models of similar scale.

    pr_agent/algo/init.py [58-59]

    -"watsonx/ibm/granite-13b-chat-v2": 8191,
    -"watsonx/ibm/granite-34b-code-instruct": 8191,
    +"watsonx/ibm/granite-13b-chat-v2": 8192,
    +"watsonx/ibm/granite-34b-code-instruct": 8192,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: While the suggestion to adjust memory allocation values for consistency is valid, the proposed change from 8191 to 8192 is minimal and may not significantly impact performance. The suggestion is correct but not crucial.

    5
    Possible issue
    Review and potentially adjust the memory allocation for 'watsonx/mistralai/mistral-large'

    Verify the memory allocation for 'watsonx/mistralai/mistral-large' to ensure it
    aligns with the expected requirements, as it significantly differs from other
    models.

    pr_agent/algo/init.py [60]

    -"watsonx/mistralai/mistral-large": 32768,
    +"watsonx/mistralai/mistral-large": 65536,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 4

    Why: The suggestion to verify the memory allocation for 'watsonx/mistralai/mistral-large' is reasonable, but the proposed change to 65536 is arbitrary without further context or justification. It raises a valid point but lacks concrete evidence.

    4

    Previous suggestions

    Suggestions up to commit f50832e
    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Adjust the value to maintain consistency and optimize memory usage

    Ensure consistent data types for dictionary values. The value for the key
    "watsonx/ibm/granite-13b-chat-v2" is 8191, which might be a typo or an
    inconsistency, as similar entries use powers of 2. Consider changing it to 8192 for
    consistency and potential optimization in memory alignment.

    pr_agent/algo/init.py [58]

    -"watsonx/ibm/granite-13b-chat-v2": 8191,
    +"watsonx/ibm/granite-13b-chat-v2": 8192,
     
    Suggestion importance[1-10]: 9

    Why: The suggestion addresses a potential typo and ensures consistency in the data, which can help in optimizing memory alignment.

    9
    Review and potentially justify the memory allocation values for new entries

    Verify the memory allocation values for consistency and correctness. The values for
    new keys are significantly lower compared to existing ones. If the lower values are
    intentional, consider adding a comment to explain the reason, ensuring
    maintainability and understanding.

    pr_agent/algo/init.py [55-57]

    -"watsonx/meta-llama/llama-3-8b-instruct": 4096,
    -"watsonx/meta-llama/llama-3-70b-instruct": 4096,
    -"watsonx/meta-llama/llama-3-405b-instruct": 16384,
    +"watsonx/meta-llama/llama-3-8b-instruct": 4096,  # Confirm if lower memory is sufficient
    +"watsonx/meta-llama/llama-3-70b-instruct": 4096,  # Confirm if lower memory is sufficient
    +"watsonx/meta-llama/llama-3-405b-instruct": 16384,  # Confirm if lower memory is sufficient
     
    Suggestion importance[1-10]: 8

    Why: The suggestion highlights a potential discrepancy in memory allocation values and encourages adding comments for clarity, which is important for maintainability and understanding.

    8
    Maintainability
    Standardize the use of quotation marks for dictionary keys

    Use consistent quotation marks for dictionary keys to maintain code style and
    readability. The keys are mixed between single and double quotes. It's recommended
    to choose one style and apply it consistently.

    pr_agent/algo/init.py [55-56]

    -'watsonx/meta-llama/llama-3-8b-instruct': 4096,
    +"watsonx/meta-llama/llama-3-8b-instruct": 4096,
     "watsonx/meta-llama/llama-3-70b-instruct": 4096,
     
    Suggestion importance[1-10]: 7

    Why: The suggestion improves code readability and maintainability by enforcing a consistent style, although it does not impact functionality.

    7
    Best practice
    Ensure consistent naming conventions in dictionary keys

    Consider using a consistent naming convention for dictionary keys. The key
    "watsonx/mistralai/mistral-large" differs in pattern from other keys which include
    model specifications like '8b', '70b'. If applicable, add the specification to
    maintain uniformity.

    pr_agent/algo/init.py [60]

    -"watsonx/mistralai/mistral-large": 32768,
    +"watsonx/mistralai/mistral-large-XXb": 32768,  # Replace XX with the appropriate specification
     
    Suggestion importance[1-10]: 6

    Why: The suggestion promotes uniformity in naming conventions, which can enhance readability and maintainability, but it requires additional context to determine the appropriate specification.

    6

    @mrT23
    Copy link
    Collaborator Author

    mrT23 commented Aug 1, 2024

    /review --pr_reviewer.extra_instructions="the generated output should be in Japanese"

    Copy link
    Contributor

    Persistent review updated to latest commit f50832e

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants