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

Optimize ways to import torch components #1099

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SPRCSY
Copy link

@SPRCSY SPRCSY commented Mar 21, 2025

Modify the import statements from a general 'import torch' to more specific 'from torch import specific_module_or_object' to potentially improve the initialization efficiency of the CosyVoice application. By specifying exactly what is needed from the torch library, the loading time can be reduced, leading to faster initialization times.

@SPRCSY
Copy link
Author

SPRCSY commented Mar 21, 2025

#1095

@SPRCSY SPRCSY changed the title Optimize ways to import torch components to make importing be faster Optimize ways to import torch components Mar 21, 2025
@aluminumbox
Copy link
Collaborator

感谢测试,但是为了可读性大家一般使用方法都是直接import torch,而且这个import是一次性的不会占用运行时间,这个pr会保留,供对性能优化有需求的同学参考

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.

2 participants