databricks / genai-cookbook

Other
46 stars 39 forks source link

Deployment error #11

Open dp12024 opened 1 month ago

dp12024 commented 1 month ago

Hello,

I'm running into a model deployment error in the following notebook: genai_cookbook/10-min-demo/Mosaic-AI-Agents-10-Minute-Demo.ipynb

Everything works fine until the following line: deployment_info = agents.deploy(model_name=UC_MODEL_NAME, model_version=uc_registered_model_info.version)

I'm using dbr 15.3 and have just run the notebook with no modifications other than changing the names of the catalog tables. The service log is of the following nature. Please let me know if you have any thoughts on how this could be resolved?

[b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/mlflow/tracing/provider.py", line 237, in wrapper [b5jcl] is_func_called, result = True, f(*args, **kwargs) [b5jcl] ^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/mlflow/pyfunc/__init__.py", line 1017, in load_model [b5jcl] model_impl = importlib.import_module(conf[MAIN])._load_pyfunc(data_path, model_config) [b5jcl] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/mlflow/langchain/__init__.py", line 884, in _load_pyfunc [b5jcl] return wrapper_cls(_load_model_from_local_fs(path, model_config), path) [b5jcl] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/mlflow/langchain/__init__.py", line 913, in _load_model_from_local_fs [b5jcl] model = _load_model_code_path( [b5jcl] ^^^^^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/mlflow/models/utils.py", line 1640, in _load_model_code_path [b5jcl] raise MlflowException( [b5jcl] mlflow.exceptions.MlflowException: Failed to run user code from /model/model.py. Error: Expecting value: line 1 column 1 (char 0).Review the stack trace for more information. [b5jcl] [2024-07-11 02:50:13 +0000] [42] [INFO] Worker exiting (pid: 42) [b5jcl] [2024-07-11 02:50:13 +0000] [58] [INFO] Booting worker with pid: 58 [b5jcl] 2024-07-11T02:50:20.+0000 ERROR mlflowserving.scoring_server An error occurred while loading the model: Failed to run user code from /model/model.py. Error: Expecting value: line 1 column 1 (char 0).Review the stack trace for more information. [b5jcl] Traceback (most recent call last): [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/requests/models.py", line 971, in json [b5jcl] return complexjson.loads(self.text, **kwargs) [b5jcl] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/json/__init__.py", line 346, in loads [b5jcl] return _default_decoder.decode(s) [b5jcl] ^^^^^^^^^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/json/decoder.py", line 337, in decode [b5jcl] obj, end = self.raw_decode(s, idx=_w(s, 0).end()) [b5jcl] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/json/decoder.py", line 355, in raw_decode [b5jcl] raise JSONDecodeError("Expecting value", s, err.value) from None [b5jcl] json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) [b5jcl] [b5jcl] During handling of the above exception, another exception occurred: [b5jcl] [b5jcl] Traceback (most recent call last): [b5jcl] File "/opt/conda/envs/mlflow-env/lib/python3.11/site-packages/mlflow/models/utils.py", line 1634, in _load_model_code_path [b5jcl] spec.loader.exec_module(module) [b5jcl] File "<frozen importlib._bootstrap_external>", line 940, in exec_module [b5jcl] File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed [b5jcl] File "/model/model.py", line 56, in <module> [b5jcl] vs_index = vs_client.get_index(

nialefs commented 1 month ago

hi @dp12024, I'm having the same error. did you solve it?