mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[Feature] bad words support v1 scheduler and specifiy token ids (#3608)
* support bad_words_token_ids * docs * fix test * fix * bad words support kvcache v1 and token ids * fix
This commit is contained in:
@@ -153,6 +153,9 @@ include_stop_str_in_output: Optional[bool] = False
|
||||
bad_words: Optional[List[str]] = None
|
||||
# List of forbidden words (e.g., sensitive words) that the model should avoid generating (default None means no restriction).
|
||||
|
||||
bad_words_token_ids: Optional[List[int]] = None
|
||||
# List of forbidden token ids that the model should avoid generating (default None means no restriction).
|
||||
|
||||
repetition_penalty: Optional[float] = None
|
||||
# Repetition penalty coefficient, reducing the probability of repeating already generated tokens (`>1.0` suppresses repetition, `<1.0` encourages repetition, default None means disabled).
|
||||
```
|
||||
@@ -340,6 +343,9 @@ include_stop_str_in_output: Optional[bool] = False
|
||||
bad_words: Optional[List[str]] = None
|
||||
# List of forbidden words (e.g., sensitive words) that the model should avoid generating (default None means no restriction).
|
||||
|
||||
bad_words_token_ids: Optional[List[int]] = None
|
||||
# List of forbidden token ids that the model should avoid generating (default None means no restriction).
|
||||
|
||||
repetition_penalty: Optional[float] = None
|
||||
# Repetition penalty coefficient, reducing the probability of repeating already generated tokens (`>1.0` suppresses repetition, `<1.0` encourages repetition, default None means disabled).
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user