-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate encoding and embedding classes
- Loading branch information
1 parent
bbd71d2
commit 4a43ca2
Showing
12 changed files
with
100 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/testFixtures/java/org/opensearch/neuralsearch/util/SparseEncodingModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.opensearch.neuralsearch.util; | ||
|
||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
public class SparseEncodingModel { | ||
private static SparseEncodingModel instance = null; | ||
|
||
public String modelId = null; | ||
|
||
private SparseEncodingModel() { | ||
|
||
} | ||
|
||
public void setModelId(String modelId) { | ||
this.modelId = modelId; | ||
} | ||
|
||
public String getModelId() { | ||
return modelId; | ||
} | ||
|
||
public static SparseEncodingModel getInstance() { | ||
// To ensure only one instance is created | ||
if (instance == null) { | ||
instance = new SparseEncodingModel(); | ||
} | ||
return instance; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/testFixtures/java/org/opensearch/neuralsearch/util/TextEmbeddingModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.opensearch.neuralsearch.util; | ||
|
||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
public class TextEmbeddingModel { | ||
private static TextEmbeddingModel instance = null; | ||
|
||
public String modelId = null; | ||
|
||
private TextEmbeddingModel() { | ||
|
||
} | ||
|
||
public void setModelId(String modelId) { | ||
this.modelId = modelId; | ||
} | ||
|
||
public String getModelId() { | ||
return modelId; | ||
} | ||
|
||
public static TextEmbeddingModel getInstance() { | ||
// To ensure only one instance is created | ||
if (instance == null) { | ||
instance = new TextEmbeddingModel(); | ||
} | ||
return instance; | ||
} | ||
} |