databricks / genai-cookbook

Other
55 stars 44 forks source link

Deployment error: module 'mlflow.langchain' has no attribute 'output_parsers' #22

Open daniel-hain opened 4 weeks ago

daniel-hain commented 4 weeks 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: with mlflow.start_run(run_name="databricks-docs-bot"): logged_chain_info = mlflow.langchain.log_model( lc_model=os.path.join( os.getcwd(), f"{QUICK_START_REPO_SAVE_FOLDER}/quick_start_demo/sample_rag_chain", ), # Chain code file from the quick start repo model_config=chain_config, # Chain configuration set above artifact_path="chain", # Required by MLflow input_example=input_example, # Save the chain's input schema. MLflow will execute the chain before logging and capturing its output schema. )

I always get the error message: MlflowException: Failed to run user code from /tmp/tmp_2mpqvqb/model.py. Error: module 'mlflow.langchain' has no attribute 'output_parsers'

Setup:

Anyone can help with that? Thanks a lot!

fgraichen commented 4 weeks ago

I ran into this as well. What version of the mlflow libraries are you using. When I upgraded to 2.15.1 (latest) this message went away, unfortunately I received a different error - log_model() got an unexpected keyword argument 'model_config' after upgrading the library. Curious if you experience the same

daniel-hain commented 4 weeks ago

Hi! I tried the same, and updated to MLflow version '2.15.1', but get the same error message.

bbqiu commented 3 weeks ago

hey all, please try pulling from latest master again -- we will be fixing this and some other small bugs with ChatCompletionOutputParser w/ the next release of mlflow.

specifically, make sure you have https://github.com/databricks/genai-cookbook/commit/8e120e44c8965824d8107dec6ab73fea15866459