Skip to content

Conversation

@mikepapadim
Copy link
Member

No description provided.

@mikepapadim mikepapadim self-assigned this Sep 4, 2025
@mikepapadim mikepapadim merged commit 2375eaa into beehive-lab:main Sep 4, 2025
1 check passed
mikepapadim added a commit that referenced this pull request Sep 4, 2025
Copy link
Contributor

Copilot AI left a 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";
Copy link

Copilot AI Sep 4, 2025

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.

Suggested change
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 uses AI. Check for mistakes.
: (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");
Copy link

Copilot AI Sep 4, 2025

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.

Suggested change
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");
}

Copilot uses AI. Check for mistakes.
(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"));
Copy link

Copilot AI Sep 4, 2025

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.

Suggested change
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")
);

Copilot uses AI. Check for mistakes.
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