Skip to content

switched cumproduct to cumprod in base_diffusion for numpy compliance + added utf8 compliance in update_model_index#518

Open
manaspgandhi wants to merge 1 commit intoopen-mmlab:masterfrom
manaspgandhi:manaspgandhi/base_diffusion_cumprod_update_utf8_compliance
Open

switched cumproduct to cumprod in base_diffusion for numpy compliance + added utf8 compliance in update_model_index#518
manaspgandhi wants to merge 1 commit intoopen-mmlab:masterfrom
manaspgandhi:manaspgandhi/base_diffusion_cumprod_update_utf8_compliance

Conversation

@manaspgandhi
Copy link
Copy Markdown

Motivation

I am using mmgeneration for a stable diffusion model. I noticed some issues in the codebase that I changed to make it work, and wanted to make sure everyone could use the codebase without issues.

Modification

  • In /mmgeneration/mmgen/models/diffusions/base_diffusion.py I changed np.cumproduct to np.cumprod. This is because np.cumproduct has been deprecated as of NumPy 1.25.0 and entirely removed in NumPy 2.0, being replaced with np.cumprod. This change will ensure compliance with the updated numpy.
  • In /mmgeneration/.dev_scripts/github/update_model_index.py I changed the with open(md_file, 'r') in get_task_dict(md_file) to with open(md_file, 'r', encoding='utf-8'), because on windows machines, it does not always automatically read the file as utf08, and causes errors for certain situations, such as pre-commit. This change will ensure all windows users don't face an issue when trying to open that md file in python.

…, as well as changed a file open in update_model_index to utf8 compliance for windows machines
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.

1 participant