<?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: How to enable word_timestamps=True when querying a Whisper model deployed in Databricks? in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120824#M928</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/24053"&gt;@lingareddy_Alva&lt;/a&gt;. I appreciate your response.&lt;BR /&gt;&lt;BR /&gt;I’ve looked for documentation but haven’t been able to find a solution. As you mentioned, I need to modify the serving endpoint’s inference logic to accept and handle this parameter. However, I don’t see any option to do that in the Serving UI, and I’m also unsure how to apply this update programmatically.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2025 13:06:01 GMT</pubDate>
    <dc:creator>JoaoPigozzo</dc:creator>
    <dc:date>2025-06-03T13:06:01Z</dc:date>
    <item>
      <title>How to enable word_timestamps=True when querying a Whisper model deployed in Databricks?</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120114#M904</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I’ve deployed OpenAI’s Whisper model as a serving endpoint in Databricks and I’m trying to transcribe an audio file.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import whisper
 
model = whisper.load_model("small")
transcript = model.transcribe(
    word_timestamps=True,
    audio="path/to/audio"
)&lt;/LI-CODE&gt;&lt;P&gt;In Databricks, I query the model like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;response = workspace_client.serving_endpoints.query(
    name="whisperv3",
    inputs=[base64_audio_chunks[first_audio_key]]
)
print(response.predictions[0])&lt;/LI-CODE&gt;&lt;P&gt;My question is: &lt;STRONG&gt;How can I enable word_timestamps=True when querying the model in Databricks?&lt;/STRONG&gt;&lt;BR /&gt;Is there a way to pass this option in the inputs or another parameter?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 20:56:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120114#M904</guid>
      <dc:creator>JoaoPigozzo</dc:creator>
      <dc:date>2025-05-23T20:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable word_timestamps=True when querying a Whisper model deployed in Databricks?</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120124#M905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/165745"&gt;@JoaoPigozzo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To enable word_timestamps=True when querying your Whisper model deployed as a serving endpoint in Databricks,&lt;BR /&gt;you must modify the serving endpoint’s inference logic to accept and process this parameter.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Update your model serving function to accept word_timestamps&lt;/STRONG&gt;&lt;BR /&gt;Inside the model serving code you deployed (likely a Python function or MLflow model),&lt;BR /&gt;update the handler to read from the input payload:&lt;/P&gt;&lt;P&gt;def predict(model_input):&lt;BR /&gt;import whisper&lt;BR /&gt;import base64&lt;BR /&gt;import io&lt;/P&gt;&lt;P&gt;audio_data = base64.b64decode(model_input["audio"])&lt;BR /&gt;audio = whisper.load_audio(io.BytesIO(audio_data))&lt;/P&gt;&lt;P&gt;word_ts = model_input.get("word_timestamps", False)&lt;/P&gt;&lt;P&gt;model = whisper.load_model("small")&lt;BR /&gt;result = model.transcribe(audio=audio, word_timestamps=word_ts)&lt;/P&gt;&lt;P&gt;return result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure the model is set up as a custom Python function model or MLflow pyfunc with&lt;BR /&gt;this logic in the predict() or model.predict() function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. Pass the parameter in your Databricks query:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;response = workspace_client.serving_endpoints.query(&lt;BR /&gt;name="whisperv3",&lt;BR /&gt;inputs={&lt;BR /&gt;"audio": base64_audio_chunks[first_audio_key],&lt;BR /&gt;"word_timestamps": True&lt;BR /&gt;}&lt;BR /&gt;)&lt;BR /&gt;print(response.predictions[0])&lt;/P&gt;&lt;P&gt;Notes:&lt;BR /&gt;If you are using MLflow to deploy, your model must include this in the predict() method in your PythonModel wrapper.&lt;BR /&gt;If using a Databricks Model Serving endpoint via custom serving handler (e.g., Model Serving with a REST API),&lt;BR /&gt;your server must interpret the incoming JSON and apply word_timestamps=True to the call to Whisper.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 May 2025 00:08:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120124#M905</guid>
      <dc:creator>lingareddy_Alva</dc:creator>
      <dc:date>2025-05-24T00:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable word_timestamps=True when querying a Whisper model deployed in Databricks?</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120224#M907</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/24053"&gt;@lingareddy_Alva&lt;/a&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response. I have deployed the Whisper model using the Serving UI, do I need to deploy with MLFlow or&amp;nbsp;&lt;SPAN&gt;serve the model with a REST API?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 12:28:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120224#M907</guid>
      <dc:creator>JoaoPigozzo</dc:creator>
      <dc:date>2025-05-26T12:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable word_timestamps=True when querying a Whisper model deployed in Databricks?</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120262#M908</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/165745"&gt;@JoaoPigozzo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you've already deployed the Whisper model using the Serving UI in Databricks,&lt;BR /&gt;whether you also need to use MLflow or a REST API depends on your use case.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;What the Serving UI Gives You:&lt;/STRONG&gt;&lt;BR /&gt;When you deploy a model (like Whisper) using Databricks Model Serving UI, Databricks:&lt;BR /&gt;1. Automatically creates a REST API endpoint&lt;BR /&gt;2. Handles scaling, versioning, and deployment&lt;BR /&gt;3. Allows token-based secure access&lt;BR /&gt;4. Provides a sample curl command, Python code, and OpenAPI spec&lt;/P&gt;&lt;P&gt;So you do not need to redeploy it with MLflow unless you need MLflow tracking or experiments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 19:17:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120262#M908</guid>
      <dc:creator>lingareddy_Alva</dc:creator>
      <dc:date>2025-05-26T19:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable word_timestamps=True when querying a Whisper model deployed in Databricks?</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120824#M928</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/24053"&gt;@lingareddy_Alva&lt;/a&gt;. I appreciate your response.&lt;BR /&gt;&lt;BR /&gt;I’ve looked for documentation but haven’t been able to find a solution. As you mentioned, I need to modify the serving endpoint’s inference logic to accept and handle this parameter. However, I don’t see any option to do that in the Serving UI, and I’m also unsure how to apply this update programmatically.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 13:06:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-enable-word-timestamps-true-when-querying-a-whisper-model/m-p/120824#M928</guid>
      <dc:creator>JoaoPigozzo</dc:creator>
      <dc:date>2025-06-03T13:06:01Z</dc:date>
    </item>
  </channel>
</rss>

