cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Got No such file or directory error while serving the endpoint

masab019
New Contributor

Hello Everyone!

I'm using Databricks for my MLOps learning, and I'm following the tutorial, and I got an error while serving the endpoint. I need help in this.

Problem Overview:

I have created a basic LightGBM model and logged it in the Unity Catalog. Then, I created a custom PyFunc wrapper for the model. Now, I need to serve an endpoint for my PyFunc wrapper model, which in this case is my custom model.

Unfortunately, I’m encountering the following error:

OSError: No such file or directory: '/model/artifacts'

I need help resolving this issue. I have double-checked everything, including the artifacts, and everything seems normal to me.

Code Files

https://github.com/musabanees/marvel-characters_mlops/blob/main/notebooks/lecture6.deploy_model_serv...

https://github.com/musabanees/marvel-characters_mlops/blob/main/src/marvel_characters/serving/model_...

Thank you

(Virus scan in progress ...)
3 REPLIES 3

sevin91580
Visitor

Hello!

The error OSError: No such file or directory: '/model/artifacts' usually means your PyFunc model is missing required files during deployment. Make sure you’ve logged the model correctly with all necessary artifacts, and that your custom wrapper references them properly. If using Unity Catalog, verify the model URI and version are accurate. You may need to re-log the model with explicit artifact paths using mlflow.pyfunc.log_model() to ensure everything is included. 

Hello @sevin91580 
Actually, the thing is, I know the exact issue, I have been trying for the past 3 days, but unable to solve it.

I’m following one of the popular course on YouTube, “MLOps with Databricks” (https://www.youtube.com/watch?v=Rt8qtjskuSs&t=754s
).
Currently, I’m on Lecture 6. I haven’t modified any part of the code that the instructors uploaded to their GitHub. In the tutorial, they were able to successfully serve the endpoint, but with the exact same code, I’m encountering a directory issue, which is quite strange.

To give you a quick recap, I’ve consolidated the code into a single file for clarity. Using the Iris dataset as an example, I first create a basic model with the scikit-learn flavor. Then, I create a PyFunc wrapper from the registered model and, finally, attempt to serve the wrapper model as an endpoint.
https://github.com/musabanees/marvel-characters_mlops/blob/main/notebooks/demo_project.py

I would appreciate it if you look at this.

Databricks recently introduced Free Edition, which opened the door for us to create a free hands-on course on MLOps with Databricks. This is lecture 6/10. Here we demonstrate how to deploy a model serving endpoint on Databricks. By the end of the course (all 10 lectures), you will get a fully ...

masab019
New Contributor

To give you a quick recap, I’ve consolidated the code into a single file for clarity. Using the Iris dataset as an example, I first create a basic model with the scikit-learn flavor. Then, I create a PyFunc wrapper from the registered model and, finally, attempt to serve the wrapper model as an endpoint.
https://github.com/musabanees/marvel-characters_mlops/blob/main/notebooks/demo_project.py

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now