community[major]: breaking change in some APIs to force users to opt-in for pickling (#18696)

This is a PR that adds a dangerous load parameter to force users to opt in to use pickle.

This is a PR that's meant to raise user awareness that the pickling module is involved.
This commit is contained in:
Eugene Yurtsev
2024-03-06 16:43:01 -05:00
committed by GitHub
parent 0e52961562
commit 4c25b49229
10 changed files with 128 additions and 7 deletions

View File

@@ -44,8 +44,9 @@ def test_serde_transform_input_fn(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("DATABRICKS_TOKEN", "my-default-token")
llm = Databricks(
endpoint_name="databricks-mixtral-8x7b-instruct",
endpoint_name="some_end_point_name", # Value should not matter for this test
transform_input_fn=transform_input,
allow_dangerous_deserialization=True,
)
params = llm._default_params
pickled_string = cloudpickle.dumps(transform_input).hex()