Skip to content

File Model Input


Compatible Spark only

This node is designed to take load in memory a machine learning model generated by an mllib pipeline. The file should be binary blob.


For the sake of keeping consistency across nodes name parameter, we have decided to keep file_path as the naming convention. As you can guess from the below example, what is expected is only the file name. The absolute or relative path of the model file should be set inside your settings as shown in the example below.


    type: punchline
    version: "6.0"
    runtime: spark
    tenant: default
    dag: [
            type: file_model_input
            component: file_model_input
            settings: {
                file_path: model.bin
            publish: [
                    // Most probably you will use this model in a mllib node
                    // You must therefore name it model. This is explained in
                    // the mllib node documentation. 
                    stream: model
        settings: {
            // Location of the input file. That path must be reachable
            // from where the spark runs. I.e. every spark node.
            // You can also use relative path like './AAPL.csv' as long
            // as you launch your pml in foreground mode from the same directory.
            // model.bin is located within the same directory as the pml you want to launch
            spark.files: ./model.bin


  • file_path: String

    Description: [Required] The name of the file specified within spark.files parameter.