Skip to content

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会保留,供对性能优化有需求的同学参考

@aluminumbox aluminumbox closed this Jun 3, 2025
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