<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pyfunc mlflow loading Databricks Model failing in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/93247#M590</link>
    <description>&lt;P&gt;Any updates? I'm facing the same problem. Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 10:30:35 GMT</pubDate>
    <dc:creator>stefa</dc:creator>
    <dc:date>2024-10-09T10:30:35Z</dc:date>
    <item>
      <title>Pyfunc mlflow loading Databricks Model failing</title>
      <link>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/92492#M580</link>
      <description>&lt;P&gt;I am running this example notebook&amp;nbsp;&lt;A href="https://docs.databricks.com/_extras/notebooks/source/machine-learning/large-language-models/pyspark-dataframe-loader-langchain.html" target="_blank"&gt;https://docs.databricks.com/_extras/notebooks/source/machine-learning/large-language-models/pyspark-dataframe-loader-langchain.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am running most as if except switching embeddings and llm to databricks from OpenAI.&lt;/P&gt;&lt;P&gt;On the last cell I am using this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;model_uri = f"runs:/{ mlflow_run.info.run_id }/retrieval_qa_chain"

loaded_pyfunc_model = mlflow.pyfunc.load_model(model_uri)
langchain_input = {"query": "Who is Harrison Schmitt"}
loaded_pyfunc_model.predict([langchain_input])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And I get the following error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ValueError: Must specify a chain Type in config
File &amp;lt;command-1908280184094495&amp;gt;, line 5
      1 model_uri = f"runs:/{ mlflow_run.info.run_id }/retrieval_qa_chain"
----&amp;gt; 5 loaded_pyfunc_model = mlflow.pyfunc.load_model(model_uri)
      6 langchain_input = {"query": "Who is Harrison Schmitt"}
      7 loaded_pyfunc_model.predict([langchain_input])


.....


File /local_disk0/.ephemeral_nfs/envs/pythonEnv-0c4b76b4-2202-4daf-abbd-9d314dbf7542/lib/python3.11/site-packages/langchain/chains/loading.py:664, in load_chain_from_config(config, **kwargs) 662 """Load chain from Config Dict.""" 663 if "_type" not in config: --&amp;gt; 664 raise ValueError("Must specify a chain Type in config") 665 config_type = config.pop("_type") 667 if config_type not in type_to_loader_dict:
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/python_api/mlflow.pyfunc.html" target="_blank"&gt;https://mlflow.org/docs/latest/python_api/mlflow.pyfunc.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The documentation on mlflow pyfunc does not give anything else. Every other cell seems to work until this very last cell.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 19:34:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/92492#M580</guid>
      <dc:creator>swollazn</dc:creator>
      <dc:date>2024-10-01T19:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pyfunc mlflow loading Databricks Model failing</title>
      <link>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/92493#M581</link>
      <description>&lt;LI-CODE lang="markup"&gt;with mlflow.start_run() as mlflow_run:
  logged_model = mlflow.langchain.log_model(
    retrieval_qa,
    "retrieval_qa_chain",
    loader_fn=load_retriever,
    persist_dir=persist_directory,
    model_config={"chain_type": "stuff"}
  )&lt;/LI-CODE&gt;&lt;P&gt;logging model as above&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 19:47:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/92493#M581</guid>
      <dc:creator>swollazn</dc:creator>
      <dc:date>2024-10-01T19:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pyfunc mlflow loading Databricks Model failing</title>
      <link>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/93247#M590</link>
      <description>&lt;P&gt;Any updates? I'm facing the same problem. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 10:30:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/93247#M590</guid>
      <dc:creator>stefa</dc:creator>
      <dc:date>2024-10-09T10:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pyfunc mlflow loading Databricks Model failing</title>
      <link>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/94315#M600</link>
      <description>&lt;P&gt;We abandoned this. Too many compatibility errors and we stuck with the notebook level. Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 15:46:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/pyfunc-mlflow-loading-databricks-model-failing/m-p/94315#M600</guid>
      <dc:creator>swollazn</dc:creator>
      <dc:date>2024-10-16T15:46:35Z</dc:date>
    </item>
  </channel>
</rss>

