Search code examples
pythonazure-machine-learning-service

Azure machine learning studio get access to the file in upload zip file


I am trying to execute Python script from Azure machine learning studio. I had a script bundle(zip file) connect to the Python script as input. There are python files, txt files and other type of files in this zip file. My question is how do I get the file path from this zip file. For example, if I have language model in this zip file, named lm.pcl, what's the file path of this language model? Thanks!


Solution

  • They're available under the ./Script Bundle directory. For example, if you were to load a pickled model from the zip file, you'd write something along these lines:

    import pandas as pd
    import pickle
    
    def azureml_main(dataframe1 = None, dataframe2 = None):
    
        model = pickle.load(open("./Script Bundle/model.pkl", "rb"))
        ...