Creating a Function : File

Creating a Function : File PRODUCT     AVGIDEA, INC. 

The File function takes a text file stored on Avgidea Storage as an object, and can perform data conversion and extraction operations on it. For example, it is possible to extract a specified range of text from a file and output it.


Creating a File Function

1. Login to the ADP console and select the "Function" -> "Editor" menu.


2. Enter the details of the function, and click the "SAVE" button.

Name : Name of the function

Description : Description of the function

Function Type : File

3. (Optional) Click on the Attach File button to attach a custom Python package to the function as a Zip file.

* AI models can be included in the package and loaded from within the function.


4. Enter any Python program in the text area.

The sample on the left shows the code loading MNIST data and outputting the results of a Tensorflow model run as a string, where the path variable is a string representing the directory in which the package containing the model was extracted.


5. Click the "SAVE" button to save the function.

Available Functions and Objects

The following is a list of functions and objects that can be used in the File function.

ifile : object of the input file

path: Directory where custom packages are located

out(string) : Output function to output file

log(string) : Output function to execution log

upload(string) : Function to upload locally located files to Storage