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 a3a525a commit 18d803aCopy full SHA for 18d803a
examples/models/llama2/builder.py
@@ -144,12 +144,15 @@ def __init__(
144
self.export_program = None
145
self.output_dir = "."
146
147
- def set_metadata(self, metadata: Optional[dict]) -> "LlamaEdgeManager":
+ def set_metadata(self, metadata: Optional[Union[dict, str]]) -> "LlamaEdgeManager":
148
"""
149
Set the metadata that will be serialized into .pte file.
150
Args:
151
metadata (Optional[dict]): Metadata for the model.
152
153
+ if isinstance(metadata, str):
154
+ with open(metadata, "r") as f:
155
+ metadata = json.load(f)
156
self.metadata = metadata
157
return self
158
0 commit comments