EmbeddingWithMOLMIM
Embedding class using MOLMIM model from NVIDIA NIM.
EmbeddingWithMOLMIM
Bases: Embeddings
Embedding class using MOLMIM model from NVIDIA NIM
Source code in aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
__init__(base_url)
Initialize the EmbeddingWithMOLMIM class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
The base URL for the NIM/MOLMIM model. |
required |
Source code in aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py
14 15 16 17 18 19 20 21 22 |
|
embed_documents(texts)
Generate embedding for a list of SMILES strings using MOLMIM model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
texts
|
List[str]
|
The list of SMILES strings to be embedded. |
required |
Returns:
Type | Description |
---|---|
List[float]
|
The list of embeddings for the given SMILES strings. |
Source code in aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
embed_query(text)
Generate embeddings for an input query using MOLMIM model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
A query to be embedded. |
required |
Returns: The embeddings for the given query.
Source code in aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py
43 44 45 46 47 48 49 50 51 52 53 54 |
|