[tx] Add support for GLM-4.7 Flash#1023
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for GLM-4.7 Flash by creating an alias to the existing DeepseekV3ForCausalLM implementation, as they share the same architecture. The change is simple and effective. However, for long-term maintainability, I've suggested a structural improvement to better separate the concerns of different model families.
| hidden_states=outputs.hidden_states, | ||
| ) | ||
|
|
||
|
|
There was a problem hiding this comment.
For better maintainability and code organization, it's preferable to avoid aliasing models from different families within the same file. While GLM-4 and DeepseekV3 currently share the same architecture, placing the Glm4MoeLiteForCausalLM alias here couples them together. If future versions of GLM-4 diverge, this file will become harder to maintain as it will contain logic for two distinct models. A better approach would be to create a separate glm4.py file that imports and aliases DeepseekV3ForCausalLM. This would keep the model implementations modular.
The architecture is the same as DeepseekV3ForCausalLM which we already support with #889