Skip to content

Commit

Permalink
Update hap_local_python.py
Browse files Browse the repository at this point in the history
Signed-off-by: Aisha Mohammed Farooq Darga <aisdarg1@in.ibm.com>
  • Loading branch information
AishaDarga authored and AishaDarga01 committed Nov 29, 2024
1 parent 8c1df6c commit ed990c3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions transforms/universal/hap/python/src/hap_local_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@
from data_processing.utils import ParamsUtils
from hap_transform_python import HAPPythonTransformConfiguration

# create parameters
# input_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "../test-data/input"))
# output_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "../output"))

input_folder = os.getenv('INPUT_FOLDER', os.path.abspath(os.path.join(os.path.dirname(__file__), "../test-data/input")))
output_folder = os.getenv('OUTPUT_FOLDER', os.path.abspath(os.path.join(os.path.dirname(__file__), "../output"))
)
print("PATHS: ", input_folder, output_folder)

local_conf = {
"input_folder": input_folder,
Expand All @@ -39,7 +34,6 @@
"runtime_code_location": ParamsUtils.convert_to_ast(code_location),
}


hap_params = {
"model_name_or_path": os.getenv('MODEL_NAME_OR_PATH', 'ibm-granite/granite-guardian-hap-38m'),
"annotation_column": os.getenv('ANNOTATION_COLUMN', "hap_score"),
Expand All @@ -52,8 +46,7 @@
if __name__ == "__main__":
# Set the simulated command line args
sys.argv = ParamsUtils.dict_to_req(d=params | hap_params)
print("PARAMs: ", hap_params)
# create launcher
launcher = PythonTransformLauncher(runtime_config=HAPPythonTransformConfiguration())
# Launch the ray actor(s) to process the input
launcher.launch()
launcher.launch()

0 comments on commit ed990c3

Please sign in to comment.