Update howto_torch2zml docs to explain why the output variable can be None.

This commit is contained in:
Foke Singh 2023-01-09 17:05:09 +00:00
parent fab1c93d5b
commit 04ad137417

View File

@ -90,7 +90,11 @@ prompt = "Q: What is the largest animal?\nA:"
# so let's stop collecting after 1000 layers.
pipeline = zml_utils.ActivationCollector(pipeline, max_layers=1000, stop_after_first_step=True)
output, activations = pipeline(prompt)
print(output)
# `output` can be `None` if activations collection
# has stopped before the end of the inference
if output:
print(output)
# Save activations to a file.
filename = model_path.split("/")[-1] + ".activations.pt"