@Yosef Hdi :
The error message you received suggests that the path parameter in the log_artifact function call expects a relative path, rather than an absolute path. To fix this issue, you can try using a relative path to the requirements.txt file instead of an absolute path. Assuming that your requirements.txt file is located in the /Shared/YOLOv8 directory, you can try using the following code to log the requirements.txt file as an artifact using a relative path:
import os
import mlflow
# get the absolute path to the current working directory
cwd = os.getcwd()
# define the relative path to the requirements.txt file
requirements_path = os.path.relpath('/dbfs/Shared/YOLOv8/requirements.txt', start=cwd)
# log the requirements.txt file as an artifact
mlflow.log_artifact(requirements_path)
In this code, os.getcwd() returns the absolute path to the current working directory. The os.path.relpath() function is then used to convert the absolute path to the requirements.txt file to a relative path based on the current working directory. Finally, mlflow.log_artifact() is called with the relative path to the requirements.txt file as the argument.
I hope this helps! Let me know if you have any other questions.