<?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: Model Registration and hosting in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/137501#M4407</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/196496"&gt;@intelliconnectq&lt;/a&gt;&amp;nbsp;The above code will fail with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;AttributeError: 'NoneType' object has no attribute 'info'&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on the line:&amp;nbsp;&lt;CODE&gt;model_uri &lt;SPAN class="token token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token token string-interpolation"&gt;f"runs:/&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;mlflow&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;active_run&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;info&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;run_id&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;}&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation"&gt;/xgboost-model"&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This happens because once the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;with mlflow.start_run():&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;block ends, the MLflow run is no longer active, so calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mlflow.active_run()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;returns&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;None&lt;/CODE&gt;. You cannot fetch run info after the run is closed.​&amp;nbsp;&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;Resolution:&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;&lt;SPAN&gt;You need to fetch the run ID&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM style="color: #1b3139; font-family: inherit;"&gt;inside&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;with&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;block while the run is still active:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;&lt;LI-CODE lang="python"&gt;with mlflow.start_run() as run:
    mlflow.xgboost.log_model(xgb_model, "xgboost-model", signature=signature)
    mlflow.log_metric("rmse", rmse)
    mlflow.log_metric("mae", mae)
    run_id = run.info.run_id  # Capture run_id here

model_uri = f"runs:/{run_id}/xgboost-model"
registered_model = mlflow.register_model(model_uri, "catalog.schema.RealEstateValueEstimator")&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 04 Nov 2025 06:45:34 GMT</pubDate>
    <dc:creator>joelrobin</dc:creator>
    <dc:date>2025-11-04T06:45:34Z</dc:date>
    <item>
      <title>Model Registration and hosting</title>
      <link>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/137486#M4406</link>
      <description>&lt;P&gt;I have train &amp;amp; tested a model in databricks, now I want to register it and host it. But I am unable too do so. Please find attach snapshot of code &amp;amp; error&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="intelliconnectq_0-1762230437372.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/21323i35B5E75BB8439E53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="intelliconnectq_0-1762230437372.png" alt="intelliconnectq_0-1762230437372.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 04:27:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/137486#M4406</guid>
      <dc:creator>intelliconnectq</dc:creator>
      <dc:date>2025-11-04T04:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Model Registration and hosting</title>
      <link>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/137501#M4407</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/196496"&gt;@intelliconnectq&lt;/a&gt;&amp;nbsp;The above code will fail with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;AttributeError: 'NoneType' object has no attribute 'info'&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on the line:&amp;nbsp;&lt;CODE&gt;model_uri &lt;SPAN class="token token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token token string-interpolation"&gt;f"runs:/&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;mlflow&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;active_run&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;info&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation"&gt;run_id&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation interpolation punctuation"&gt;}&lt;/SPAN&gt;&lt;SPAN class="token token string-interpolation"&gt;/xgboost-model"&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This happens because once the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;with mlflow.start_run():&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;block ends, the MLflow run is no longer active, so calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mlflow.active_run()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;returns&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;None&lt;/CODE&gt;. You cannot fetch run info after the run is closed.​&amp;nbsp;&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;Resolution:&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;&lt;SPAN&gt;You need to fetch the run ID&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM style="color: #1b3139; font-family: inherit;"&gt;inside&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;with&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;block while the run is still active:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;&lt;LI-CODE lang="python"&gt;with mlflow.start_run() as run:
    mlflow.xgboost.log_model(xgb_model, "xgboost-model", signature=signature)
    mlflow.log_metric("rmse", rmse)
    mlflow.log_metric("mae", mae)
    run_id = run.info.run_id  # Capture run_id here

model_uri = f"runs:/{run_id}/xgboost-model"
registered_model = mlflow.register_model(model_uri, "catalog.schema.RealEstateValueEstimator")&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Nov 2025 06:45:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/137501#M4407</guid>
      <dc:creator>joelrobin</dc:creator>
      <dc:date>2025-11-04T06:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Model Registration and hosting</title>
      <link>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/138325#M4419</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 04:22:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/model-registration-and-hosting/m-p/138325#M4419</guid>
      <dc:creator>intelliconnectq</dc:creator>
      <dc:date>2025-11-10T04:22:06Z</dc:date>
    </item>
  </channel>
</rss>

