I have the below score.py file I trying to deploy using Azure ACI. The issue is Im getting module not found error indicating my python cleaning script ('cpp_data_prep_methods') cannot be found even though I have the score.py and pyhthon script in same folder.
My python script is also reading a csv file that is also found in same folder. My question is, Is it possible to call a personally written cleaning script inside score.py? Below shows how I'm calling my script (cpp_data_prep_methods )
import joblib
import os
import pandas as pd
import json
import numpy as np
from azureml.core import Workspace, workspace
import yaml
import sys
#sys.path.append(os.path.abspath(os.path.join('..')))
from cpp_data_prep_methods import *
import warnings
warnings.filterwarnings("ignore")
def init():
global model
model_path = Model.get_model_path(
model_name="test_model.pkl")
model = joblib.load(model_path)
init()
def run(raw_data):
try:
data = json.loads(raw_data)["data"]
# Clean Data using my cleaning script with csv and txt files inside.
data = cpp_all_data_prep(data, verbose=False)
new_data = np.array(data)
result = model.predict(new_data)
return result.tolist()
except Exception as e:
error = str(e)
return error```