in src/smexperiments/tracker.py [0:0]
def log_input_artifact(self, file_path, name=None, media_type=None):
"""Upload a local file to s3 and store it as an input artifact in this trial component.
Examples
.. code-block:: python
# log local artifact
my_tracker.log_input_artifact(file_path='/local/path/artifact.tar.gz')
Args:
file_path (str): The path of the local file to upload.
name (str, optional): The name of the artifact.
media_type (str, optional): The MediaType (MIME type) of the file. If not specified, this library
will attempt to infer the media type from the file extension of ``file_path``.
"""
if len(self.trial_component.input_artifacts) >= 30:
raise ValueError("Cannot add more than 30 input_artifacts under tracker trial_component.")
media_type = media_type or _guess_media_type(file_path)
name = name or _resolve_artifact_name(file_path)
s3_uri, etag = self._artifact_uploader.upload_artifact(file_path)
self.trial_component.input_artifacts[name] = api_types.TrialComponentArtifact(
value=s3_uri, media_type=media_type
)
self._lineage_artifact_tracker.add_input_artifact(name, s3_uri, etag, media_type)