-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): add multimodal embedding test model (#683)
Because - we are missing multimodal embedding test model This commit - add multimodal embedding test model
- Loading branch information
Showing
7 changed files
with
55 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
Task: Embedding | ||
Tags: | ||
- Embedding | ||
- Test | ||
--- | ||
|
||
# Test repo | ||
This is a dummy multi-modal embedding model for testing purpose |
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,4 @@ | ||
build: | ||
gpu: false | ||
python_version: "3.11" # support only 3.11 | ||
python_packages: |
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,34 @@ | ||
import time | ||
from instill.helpers.ray_config import instill_deployment, InstillDeployable | ||
from instill.helpers import ( | ||
parse_task_embedding_to_multimodal_embedding_input, | ||
construct_task_embedding_output, | ||
) | ||
|
||
|
||
@instill_deployment | ||
class MultimodalEmbedding: | ||
def __init__(self): | ||
pass | ||
|
||
async def __call__(self, request): | ||
|
||
inputs = await parse_task_embedding_to_multimodal_embedding_input(request=request) | ||
|
||
input_len = len(inputs) | ||
|
||
indexes = [list(range(input_len))] | ||
created = [[int(time.time())] for _ in range(input_len)] | ||
embeddings = [ | ||
[[0.00001, -0.00001, 0.00002, 0.001230]] for _ in range(input_len) | ||
] | ||
|
||
return construct_task_embedding_output( | ||
request=request, | ||
indexes=indexes, | ||
created_timestamps=created, | ||
embeddings=embeddings, | ||
) | ||
|
||
|
||
entrypoint = InstillDeployable(MultimodalEmbedding).get_deployment_handle() |
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