We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca59d5b commit 1e7cba4Copy full SHA for 1e7cba4
ads/llm/deploy.py
@@ -19,13 +19,19 @@
19
20
21
class ChainDeployment(GenericModel):
22
+ """Represents a model deployment with LangChain.
23
+ """
24
def __init__(self, chain, **kwargs):
25
self.chain = chain
26
+ if "model_input_serializer" not in kwargs:
27
+ kwargs["model_input_serializer"] = self.model_input_serializer_type.JSON
28
super().__init__(**kwargs)
29
30
def prepare(self, **kwargs) -> GenericModel:
31
"""Prepares the model artifact."""
32
chain_yaml_uri = os.path.join(self.artifact_dir, "chain.yaml")
33
+ if not os.path.exists(self.artifact_dir):
34
+ os.makedirs(self.artifact_dir)
35
with open(chain_yaml_uri, "w", encoding="utf-8") as f:
36
f.write(yaml.safe_dump(dump(self.chain)))
37
0 commit comments