MilanM commited on
Commit
bb9bbc6
·
verified ·
1 Parent(s): d2e8fe4

Update main_app.py

Browse files
Files changed (1) hide show
  1. main_app.py +8 -2
main_app.py CHANGED
@@ -827,9 +827,15 @@ def _(
827
  # Change to /tmp directory before calling IBM Watson SDK functions
828
  os.chdir('/tmp')
829
 
 
 
 
 
 
 
830
  # Upload using the file path approach
831
- mo.md(f"Uploading function from file: {file_path}")
832
- func_details = deployment_client.repository.store_function(file_path, function_meta)
833
 
834
  set_upload_status(f"Latest Upload - id - {func_details['metadata']['id']}")
835
  return func_details
 
827
  # Change to /tmp directory before calling IBM Watson SDK functions
828
  os.chdir('/tmp')
829
 
830
+ # Upload using the absolute file path
831
+ abs_file_path = os.path.abspath(file_path)
832
+ mo.md(f"Uploading function from file: {abs_file_path}")
833
+
834
+ # Using the absolute file path might help in some environments
835
+ func_details = deployment_client.repository.store_function(abs_file_path, function_meta)
836
  # Upload using the file path approach
837
+ # mo.md(f"Uploading function from file: {file_path}")
838
+ # func_details = deployment_client.repository.store_function(file_path, function_meta)
839
 
840
  set_upload_status(f"Latest Upload - id - {func_details['metadata']['id']}")
841
  return func_details