Skip to Content
0
Jul 28 at 03:21 PM

read a ml model artifact in jupyter notebook in SAP DI

152 Views

Hello,

I'm trying to load my ml model (artifact) which I produced using a producer pipeline, into my jupyter notebook of the same ml scenario. came across some blogs and the documentation of accessing the artifact but nothing seems to be working.

the code I'm using (from the documentation of accessing an artifact):

from sapdi.artifact.artifact import Artifact
artifact = Artifact.get(artifact_id='xxxx-yyyy-xxxx') #id goes here
file_handler = artifact.open_file("model.csv")
with file_handler.get_reader() as f:
    content = f.read()
same_content = file_handler.read()

Error:

The provided file_name model.csv does not match with the actual file name artifactproducer1_0 of the FILE type artifact. Please either skip the file_name argument or provide the correct file name

any help would be appreciated :)

Thank you,
Aditya