mirror of
https://github.com/turboderp-org/exllamav2.git
synced 2026-04-20 14:29:28 +00:00
Added banned_strings parameter to the generator. (#756)
Co-authored-by: RaahimSiddiqi <Raahim.siddiqi@vidizmo.com>
This commit is contained in:
@@ -556,6 +556,7 @@ class ExLlamaV2DynamicGenerator:
|
||||
filter_prefer_eos: bool = False,
|
||||
return_last_results: bool = False,
|
||||
embeddings: list[ExLlamaV2MMEmbedding] | list[list[ExLlamaV2MMEmbedding]] | None = None,
|
||||
banned_strings: list | None = None,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
@@ -617,6 +618,9 @@ class ExLlamaV2DynamicGenerator:
|
||||
:param embeddings:
|
||||
Optional list of ExLlamaV2MMEmbeddings to use for, or list of lists for batched generation
|
||||
|
||||
:param banned_strings:
|
||||
Optional list of strings to exclude from the output
|
||||
|
||||
:return:
|
||||
Completion(s): (str or list[str] depending on the type of the input prompt argument)
|
||||
Optionally, last results: (dict or list[dict] depending on the type of the input prompt argument)
|
||||
@@ -685,7 +689,8 @@ class ExLlamaV2DynamicGenerator:
|
||||
filter_prefer_eos = filter_prefer_eos,
|
||||
token_healing = token_healing,
|
||||
decode_special_tokens = decode_special_tokens,
|
||||
embeddings = embeddings[idx] or []
|
||||
embeddings = embeddings[idx] or [],
|
||||
banned_strings = banned_strings
|
||||
)
|
||||
|
||||
if seed is not None: seed += 1
|
||||
|
||||
Reference in New Issue
Block a user