transformed_embedding_scanner
Modules:
Name | Description |
---|---|
scanner |
|
stainedglass_core |
|
universal |
Model-agnostic |
utils |
|
version |
Constants storing the version numbers for major changes to the codebase. |
Classes:
Name | Description |
---|---|
TransformedEmbeddingScanner |
Scans LLM input embeddings for unauthorized prompts. |
TransformedEmbeddingScanner
¶
Bases: EmbeddingScanner
Scans LLM input embeddings for unauthorized prompts.
Methods:
Name | Description |
---|---|
__init__ |
Construct a |
scan |
Scan and detect unauthorized embeddings in the input. |
__init__
¶
scan
¶
scan(input_embeddings: Tensor) -> None
Scan and detect unauthorized embeddings in the input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Tensor
|
Input embeddings for LLM generation. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the dtype, embedding dimension, or batch size of the input embeddings are invalid. |
RuntimeError
|
If any of the input embeddings are invalid. |