Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OpenBMB/MiniCPM-o
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: RahulVadisetty91/chat_v2_refactor.py
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Aug 29, 2024

  1. chat_refactor.py

    When comparing the new script to the old one several improvements and changes have been made to improve functionality and readability of the script. 
     
     First, using names of stores for LinearStrings such as `const errImageDecode = ‘Image decode error’ improves the read and maintain ability of code all over the script. This change means that any time there is need to alter these values, it has to be done only once hence minimizing chances of making errors while making the changes. 
     
     The class names have been changed to follow the naming standards and the class names are ‘MiniCPMV2. 5’ but it has been changed to ‘MiniCPMV2_5’ and the another class name is ‘MiniCPMV2. 6’ but it has been changed to ‘MiniCPMV2_6”. This change follows Python’s convention of meaningful and clear naming of variables, thus improving readability of the code and making it easier to get an idea of what does a certain class in the code does out of the box. 
     
     Local variables which are not used like ‘context’ in the `MiniCPMV2_5` class have been named with underscores to show that they are deliberately unused. Such an adjustment eliminates confusion and makes it clearer as to what the code is seeking to achieve. 
     
     Also included are constant contexts to replace duplicated string literals like `llm. model. embed_tokens` of this project. This makes the code much cleaner and also gives the proper way to update them if ever needed efficiently. 
     
     The layout also has improved error checking capabilities and better from the ground up logic for multi-GPU, it is better and more reliable. There are also new features like Dynamic Device Mapping for activating and managing all idle devices and GPU load for making computations on large models much faster. 
     
     In other words these changes can be described as those which make code more concise, maintainable and compliant with common conventions and thus make the script cleaner.
    RahulVadisetty91 authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    208559d View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from RahulVadisetty91/RahulVadisetty91-patch-1

    Code Cleanup and Enhancement: Applied Constants, Update Class Names and optimised the Multi-GPU Support.
    RahulVadisetty91 authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    4eba16f View commit details
    Browse the repository at this point in the history
Loading