Skip to content

Commit b0d61c1

Browse files
committed
cleanup
Signed-off-by: Mandana Vaziri <[email protected]>
1 parent 2ee203e commit b0d61c1

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/pdl/pdl_ast.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,20 +627,26 @@ def set_default_model_params(
627627
)
628628
return params
629629

630+
630631
def set_structured_decoding_parameters(
631632
spec: Any,
632-
parameters: Optional[dict[str, Any]],
633+
parameters: Optional[dict[str, Any]],
633634
) -> dict[str, Any]:
634635
if parameters is None:
635636
parameters = {}
636-
637-
if spec is not None and parameters["response_format"] is None and "guided_decoding_backend" not in parameters :
637+
638+
if (
639+
spec is not None
640+
and parameters["response_format"] is None
641+
and "guided_decoding_backend" not in parameters
642+
):
638643
schema = pdltype_to_jsonschema(spec, True)
639644
parameters["guided_decoding_backend"] = "lm-format-enforcer"
640645
parameters["guided_json"] = schema
641-
#parameters["response_format"] = { "type": "json_schema", "json_schema": schema , "strict": True }
646+
# parameters["response_format"] = { "type": "json_schema", "json_schema": schema , "strict": True }
642647
return parameters
643648

649+
644650
def set_default_granite_model_parameters(
645651
model_id: str,
646652
spec: Any,
@@ -652,12 +658,12 @@ def set_default_granite_model_parameters(
652658
if "watsonx" in model_id:
653659
if "decoding_method" not in parameters:
654660
parameters["decoding_method"] = (
655-
DECODING_METHOD # pylint: disable=attribute-defined-outside-init
656-
)
661+
DECODING_METHOD # pylint: disable=attribute-defined-outside-init
662+
)
657663
if "max_tokens" in parameters and parameters["max_tokens"] is None:
658664
parameters["max_tokens"] = (
659-
MAX_NEW_TOKENS # pylint: disable=attribute-defined-outside-init
660-
)
665+
MAX_NEW_TOKENS # pylint: disable=attribute-defined-outside-init
666+
)
661667
if "min_new_tokens" not in parameters:
662668
parameters["min_new_tokens"] = (
663669
MIN_NEW_TOKENS # pylint: disable=attribute-defined-outside-init

src/pdl/pdl_interpreter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,9 +1128,9 @@ def get_transformed_inputs(kwargs):
11281128
msg, raw_result = yield from generate_client_response(
11291129
state, concrete_block, model_input
11301130
)
1131-
#if "input" in litellm_params:
1131+
# if "input" in litellm_params:
11321132
append_log(state, "Model Input", litellm_params)
1133-
#else:
1133+
# else:
11341134
# append_log(state, "Model Input", messages_to_str(model_input))
11351135
background: Messages = [msg]
11361136
result = "" if msg["content"] is None else msg["content"]

0 commit comments

Comments
 (0)