Skip to content

Commit 05f4cbf

Browse files
author
Your Name
committed
fix formatting
1 parent 247d4e8 commit 05f4cbf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

vllm/beam/filtering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ def format_filter(filter_params_list):
2121
return [dict(zip(keys, vals)) for vals in filter_params_list]
2222

2323

24-
DEFAULT_CHAR_SERVER_FILTER = format_filter(
25-
[{"name": "annotations_porn", "threshold": 0.5156}, {"name": "annotations_racist", "threshold": 0.9763}, {"name": "annotations_disturbing", "threshold": 0.5472}, {"name": "annotations_harmful_promotes_selfharm", "threshold": 0.0657}]
26-
)
24+
DEFAULT_CHAR_SERVER_FILTER = [{"name": "annotations_porn", "threshold": 0.5156}, {"name": "annotations_racist", "threshold": 0.9763}, {"name": "annotations_disturbing", "threshold": 0.5472}, {"name": "annotations_harmful_promotes_selfharm", "threshold": 0.0657}]
2725

2826
MAX_GENERATIONS = 10
2927
_CHUNK_SIZE = 16
@@ -113,6 +111,8 @@ def get_filtered_classifiers(self, prob_C, filter_params) -> list[str]:
113111
if p["name"] in self.classifier_names
114112
]
115113

114+
print(f"prob_C: {prob_C}")
115+
print(f"relevant_filters: {relevant_filters}")
116116
if not relevant_filters:
117117
return []
118118

vllm/beam/penalty.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def format_penalty(penalty_params_list):
646646
return [dict(zip(keys, vals)) for vals in penalty_params_list]
647647

648648

649-
MODEL_SERVER_PENALTY = format_penalty([{"name": "annotations_sexually_suggestive", "penalty": 15000, "final_threshold": 0.4484, "per_unit_penalty": 0}, {"name": "annotations_porn", "penalty": 15000, "final_threshold": 0.4378, "per_unit_penalty": 0}, {"name": "annotations_porn", "penalty": 20000, "final_threshold": 0.7773, "per_unit_penalty": 1}, {"name": "annotations_racist", "penalty": 20000, "final_threshold": 0.9763, "per_unit_penalty": 1}, {"name": "annotations_disturbing", "penalty": 15000, "final_threshold": 0.4156, "per_unit_penalty": 1}, {"name": "annotations_harmful_promotes_selfharm", "penalty": 10000, "final_threshold": 0.0657, "per_unit_penalty": 1}, {"name": "annotations_harmful_promotes_selfharm", "penalty": 10001, "final_threshold": 0.0017, "per_unit_penalty": 1}, {"name": "repetitive", "penalty": 1000, "final_threshold": 0.8164, "per_unit_penalty": 1}, {"name": "annotations_nonsense_gd", "penalty": 1000, "final_threshold": 0.2539, "per_unit_penalty": 1}, {"name": "annotations_looping", "penalty": 1000, "final_threshold": 0.1944, "per_unit_penalty": 1}, {"name": "annotations_out_of_character_gd", "penalty": 1000, "final_threshold": 0.3631, "per_unit_penalty": 1}])
649+
MODEL_SERVER_PENALTY = [{"name": "annotations_sexually_suggestive", "penalty": 15000, "final_threshold": 0.4484, "per_unit_penalty": 0}, {"name": "annotations_porn", "penalty": 15000, "final_threshold": 0.4378, "per_unit_penalty": 0}, {"name": "annotations_porn", "penalty": 20000, "final_threshold": 0.7773, "per_unit_penalty": 1}, {"name": "annotations_racist", "penalty": 20000, "final_threshold": 0.9763, "per_unit_penalty": 1}, {"name": "annotations_disturbing", "penalty": 15000, "final_threshold": 0.4156, "per_unit_penalty": 1}, {"name": "annotations_harmful_promotes_selfharm", "penalty": 10000, "final_threshold": 0.0657, "per_unit_penalty": 1}, {"name": "annotations_harmful_promotes_selfharm", "penalty": 10001, "final_threshold": 0.0017, "per_unit_penalty": 1}, {"name": "repetitive", "penalty": 1000, "final_threshold": 0.8164, "per_unit_penalty": 1}, {"name": "annotations_nonsense_gd", "penalty": 1000, "final_threshold": 0.2539, "per_unit_penalty": 1}, {"name": "annotations_looping", "penalty": 1000, "final_threshold": 0.1944, "per_unit_penalty": 1}, {"name": "annotations_out_of_character_gd", "penalty": 1000, "final_threshold": 0.3631, "per_unit_penalty": 1}]
650650

651651

652652
class PenaltyComputer:

0 commit comments

Comments
 (0)