-
Couldn't load subscription status.
- Fork 22
Minor cleanup #47
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
Minor cleanup #47
Conversation
…ation setup and conditional checks; integrate TornadoVM initialization flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR performs minor cleanup in the Qwen2ModelLoader.java file, primarily focusing on code formatting and import organization.
- Removes unused imports and Timer usage
- Reformats multi-line statements to single lines for improved readability
- Adds conditional logging for TornadoVM weight loading
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| String modelName = "DeepSeek-R1-Distill-Qwen".equals(basename) | ||
| ? "DeepSeek-R1-Distill-Qwen" | ||
| : "Qwen2.5"; | ||
| String modelName = "DeepSeek-R1-Distill-Qwen".equals(basename) ? "DeepSeek-R1-Distill-Qwen" : "Qwen2.5"; |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This line exceeds typical line length conventions (appears to be over 100 characters). Consider breaking the ternary operator across multiple lines for better readability.
| String modelName = "DeepSeek-R1-Distill-Qwen".equals(basename) ? "DeepSeek-R1-Distill-Qwen" : "Qwen2.5"; | |
| String modelName = "DeepSeek-R1-Distill-Qwen".equals(basename) | |
| ? "DeepSeek-R1-Distill-Qwen" | |
| : "Qwen2.5"; |
| : (int) metadata.get("qwen2.attention.head_count"); | ||
| Qwen2Configuration config = new Qwen2Configuration( | ||
| (int) metadata.get("qwen2.embedding_length"), // dim | ||
| int numberOfKeyValueHeads = metadata.containsKey("qwen2.attention.head_count_kv") ? (int) metadata.get("qwen2.attention.head_count_kv") : (int) metadata.get("qwen2.attention.head_count"); |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This line is excessively long (over 150 characters) and reduces readability. Consider breaking it into multiple lines or extracting the conditional logic into a separate variable.
| int numberOfKeyValueHeads = metadata.containsKey("qwen2.attention.head_count_kv") ? (int) metadata.get("qwen2.attention.head_count_kv") : (int) metadata.get("qwen2.attention.head_count"); | |
| int numberOfKeyValueHeads; | |
| if (metadata.containsKey("qwen2.attention.head_count_kv")) { | |
| numberOfKeyValueHeads = (int) metadata.get("qwen2.attention.head_count_kv"); | |
| } else { | |
| numberOfKeyValueHeads = (int) metadata.get("qwen2.attention.head_count"); | |
| } |
| (float) metadata.get("qwen2.attention.layer_norm_rms_epsilon"), | ||
| (float) metadata.get("qwen2.rope.freq_base") | ||
| ); | ||
| vocabulary.size(), modelContextLength, contextLength, false, (float) metadata.get("qwen2.attention.layer_norm_rms_epsilon"), (float) metadata.get("qwen2.rope.freq_base")); |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This constructor call with multiple parameters on a single line is difficult to read and maintain. Consider formatting each parameter on a separate line for better readability.
| vocabulary.size(), modelContextLength, contextLength, false, (float) metadata.get("qwen2.attention.layer_norm_rms_epsilon"), (float) metadata.get("qwen2.rope.freq_base")); | |
| vocabulary.size(), | |
| modelContextLength, | |
| contextLength, | |
| false, | |
| (float) metadata.get("qwen2.attention.layer_norm_rms_epsilon"), | |
| (float) metadata.get("qwen2.rope.freq_base") | |
| ); |
No description provided.