Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refactor nested stream in embedMany method to enhance readability #10

Copy link
Copy link
@aulorbe

Description

@aulorbe
Issue body actions

// Create an empty list to hold the lists of Float values
List<List> floatEmbeddings = new ArrayList<>();

// Iterate over each Embedding object
for (Embedding embedding : embeddings) {
// Create a new list to hold the Float values for this embedding
List floatList = new ArrayList<>();

// Convert each Double value to Float and add it to the list
for (Double value : embedding.getEmbedding()) {
    floatList.add(value.floatValue());
}

// Add the list of Float values to the outer list
floatEmbeddings.add(floatList);

}

return floatEmbeddings;

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.