Skip to content

Conversation

@csuwl
Copy link
Contributor

@csuwl csuwl commented Nov 20, 2024

add ollama model options:llama-vision,qwen2.5

@Override
public String getName() {
return this.id;
return this.id + (null == this.size ? "" : ":" + this.size);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Null Handling in getName:

The logic in getName assumes size will be null or non-empty but doesn't guard against unexpected input like an empty string.
Add validation to handle this edge case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no difference between id and name, then that's right

@Override
public String getName() {
return this.id;
return this.id + (null == this.size ? "" : ":" + this.size);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return this.id + (null == this.size ? "" : ":" + this.size);
return this.id + (this.size == null || this.size.isEmpty() ? "" : ":" + this.size);

…llama/api/OllamaModel.java


If there is no difference between id and name, then that's right

Co-authored-by: ogbozoyan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants