Skip to content

Commit 8ab2558

Browse files
julian-rischclaude
authored andcommitted
chore: deprecate whisper components (LocalWhisperTranscriber, RemoteWhisperTranscriber) (#11685)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent a24c54e commit 8ab2558

5 files changed

Lines changed: 53 additions & 30 deletions

File tree

docs-website/docs/pipeline-components/audio/localwhispertranscriber.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ Use `LocalWhisperTranscriber` to transcribe audio files using OpenAI's Whisper m
1616
| **Most common position in a pipeline** | As the first component in an indexing pipeline |
1717
| **Mandatory run variables** | `sources`: A list of paths or binary streams that you want to transcribe |
1818
| **Output variables** | `documents`: A list of documents |
19-
| **API reference** | [Audio](/reference/audio-api) |
20-
| **GitHub link** | https://github.com/deepset-ai/haystack/blob/main/haystack/components/audio/whisper_local.py |
21-
| **Package name** | `haystack-ai` |
19+
| **API reference** | [Whisper](/reference/integrations-whisper) |
20+
| **GitHub link** | https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/whisper |
21+
| **Package name** | `whisper-haystack` |
2222

2323
</div>
2424

2525
## Overview
2626

2727
The component also needs to know which Whisper model to work with. Specify this in the `model` parameter when initializing the component. All transcription is completed on the executing machine, and the audio is never sent to a third-party provider.
2828

29-
See other optional parameters you can specify in our [API documentation](/reference/audio-api).
29+
See other optional parameters you can specify in our [API documentation](/reference/integrations-whisper).
3030

3131
See the [Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper [GitHub repo](https://github.com/openai/whisper) for the supported audio formats and languages.
3232

33-
To work with the `LocalWhisperTranscriber`, install torch and [Whisper](https://github.com/openai/whisper) first with the following commands:
33+
The `LocalWhisperTranscriber` is part of the `whisper-haystack` integration package. To work with it, install the package along with [Whisper](https://github.com/openai/whisper) (which also pulls in torch) using the following commands:
3434

3535
```python
36-
pip install 'transformers[torch]'
36+
pip install whisper-haystack
3737
pip install -U openai-whisper
3838
```
3939

@@ -45,7 +45,7 @@ Here’s an example of how to use `LocalWhisperTranscriber` on its own:
4545

4646
```python
4747
import requests
48-
from haystack.components.audio import LocalWhisperTranscriber
48+
from haystack_integrations.components.audio.whisper import LocalWhisperTranscriber
4949

5050
response = requests.get(
5151
"https://ia903102.us.archive.org/19/items/100-Best--Speeches/EK_19690725_64kb.mp3",
@@ -64,7 +64,7 @@ print(transcription["documents"][0].content)
6464
The pipeline below fetches an audio file from a specified URL and transcribes it. It first retrieves the audio file using `LinkContentFetcher`, then transcribes the audio into text with `LocalWhisperTranscriber`, and finally outputs the transcription text.
6565

6666
```python
67-
from haystack.components.audio import LocalWhisperTranscriber
67+
from haystack_integrations.components.audio.whisper import LocalWhisperTranscriber
6868
from haystack.components.fetchers import LinkContentFetcher
6969
from haystack import Pipeline
7070

docs-website/docs/pipeline-components/audio/remotewhispertranscriber.mdx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,27 @@ Use `RemoteWhisperTranscriber` to transcribe audio files using OpenAI's Whisper
1717
| **Mandatory init variables** | `api_key`: An OpenAI API key. Can be set with an environment variable `OPENAI_API_KEY`. |
1818
| **Mandatory run variables** | `sources`: A list of paths or binary streams that you want to transcribe |
1919
| **Output variables** | `documents`: A list of documents |
20-
| **API reference** | [Audio](/reference/audio-api) |
21-
| **GitHub link** | https://github.com/deepset-ai/haystack/blob/main/haystack/components/audio/whisper_remote.py |
22-
| **Package name** | `haystack-ai` |
20+
| **API reference** | [Whisper](/reference/integrations-whisper) |
21+
| **GitHub link** | https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/whisper |
22+
| **Package name** | `whisper-haystack` |
2323

2424
</div>
2525

2626
## Overview
2727

28+
The `RemoteWhisperTranscriber` is part of the `whisper-haystack` integration package. Install it with:
29+
30+
```python
31+
pip install whisper-haystack
32+
```
33+
2834
`RemoteWhisperTranscriber` works with OpenAI-compatible clients and isn't limited to just OpenAI as a provider. For example, [Groq](https://console.groq.com/docs/speech-text) offers a drop-in replacement that can be used as well. You can set the API key in one of two ways:
2935

3036
1. Through the `api_key` initialization parameter, where the key is resolved using [Secret API](../../concepts/secret-management.mdx).
3137
2. By setting it in the `OPENAI_API_KEY` environment variable, which the system will use to access the key.
3238

3339
```python
34-
from haystack.components.audio import RemoteWhisperTranscriber
40+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber
3541

3642
transcriber = RemoteWhisperTranscriber()
3743
```
@@ -41,7 +47,7 @@ Additionally, the component requires the following parameters to work:
4147
- `model` specifies the Whisper model.
4248
- `api_base_url` specifies the OpenAI base URL and defaults to `"https://api.openai.com/v1"`. If you are using Whisper provider other than OpenAI set this parameter according to provider's documentation.
4349

44-
See other optional parameters in our [API documentation](/reference/audio-api).
50+
See other optional parameters in our [API documentation](/reference/integrations-whisper).
4551

4652
See the [Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper [GitHub repo](https://github.com/openai/whisper) for the supported audio formats and languages.
4753

@@ -53,7 +59,7 @@ Here’s an example of how to use `RemoteWhisperTranscriber` to transcribe a loc
5359

5460
```python
5561
import requests
56-
from haystack.components.audio import RemoteWhisperTranscriber
62+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber
5763

5864
response = requests.get(
5965
"https://ia903102.us.archive.org/19/items/100-Best--Speeches/EK_19690725_64kb.mp3",
@@ -72,7 +78,7 @@ print(transcription["documents"][0].content)
7278
The pipeline below fetches an audio file from a specified URL and transcribes it. It first retrieves the audio file using `LinkContentFetcher`, then transcribes the audio into text with `RemoteWhisperTranscriber`, and finally outputs the transcription text.
7379

7480
```python
75-
from haystack.components.audio import RemoteWhisperTranscriber
81+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber
7682
from haystack.components.fetchers import LinkContentFetcher
7783
from haystack import Pipeline
7884

docs-website/versioned_docs/version-2.30/pipeline-components/audio/localwhispertranscriber.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ Use `LocalWhisperTranscriber` to transcribe audio files using OpenAI's Whisper m
1616
| **Most common position in a pipeline** | As the first component in an indexing pipeline |
1717
| **Mandatory run variables** | `sources`: A list of paths or binary streams that you want to transcribe |
1818
| **Output variables** | `documents`: A list of documents |
19-
| **API reference** | [Audio](/reference/audio-api) |
20-
| **GitHub link** | https://github.com/deepset-ai/haystack/blob/main/haystack/components/audio/whisper_local.py |
21-
| **Package name** | `haystack-ai` |
19+
| **API reference** | [Whisper](/reference/integrations-whisper) |
20+
| **GitHub link** | https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/whisper |
21+
| **Package name** | `whisper-haystack` |
2222

2323
</div>
2424

2525
## Overview
2626

2727
The component also needs to know which Whisper model to work with. Specify this in the `model` parameter when initializing the component. All transcription is completed on the executing machine, and the audio is never sent to a third-party provider.
2828

29-
See other optional parameters you can specify in our [API documentation](/reference/audio-api).
29+
See other optional parameters you can specify in our [API documentation](/reference/integrations-whisper).
3030

3131
See the [Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper [GitHub repo](https://github.com/openai/whisper) for the supported audio formats and languages.
3232

33-
To work with the `LocalWhisperTranscriber`, install torch and [Whisper](https://github.com/openai/whisper) first with the following commands:
33+
The `LocalWhisperTranscriber` is part of the `whisper-haystack` integration package. To work with it, install the package along with [Whisper](https://github.com/openai/whisper) (which also pulls in torch) using the following commands:
3434

3535
```python
36-
pip install 'transformers[torch]'
36+
pip install whisper-haystack
3737
pip install -U openai-whisper
3838
```
3939

@@ -45,7 +45,7 @@ Here’s an example of how to use `LocalWhisperTranscriber` on its own:
4545

4646
```python
4747
import requests
48-
from haystack.components.audio import LocalWhisperTranscriber
48+
from haystack_integrations.components.audio.whisper import LocalWhisperTranscriber
4949

5050
response = requests.get(
5151
"https://ia903102.us.archive.org/19/items/100-Best--Speeches/EK_19690725_64kb.mp3",
@@ -64,7 +64,7 @@ print(transcription["documents"][0].content)
6464
The pipeline below fetches an audio file from a specified URL and transcribes it. It first retrieves the audio file using `LinkContentFetcher`, then transcribes the audio into text with `LocalWhisperTranscriber`, and finally outputs the transcription text.
6565

6666
```python
67-
from haystack.components.audio import LocalWhisperTranscriber
67+
from haystack_integrations.components.audio.whisper import LocalWhisperTranscriber
6868
from haystack.components.fetchers import LinkContentFetcher
6969
from haystack import Pipeline
7070

docs-website/versioned_docs/version-2.30/pipeline-components/audio/remotewhispertranscriber.mdx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,27 @@ Use `RemoteWhisperTranscriber` to transcribe audio files using OpenAI's Whisper
1717
| **Mandatory init variables** | `api_key`: An OpenAI API key. Can be set with an environment variable `OPENAI_API_KEY`. |
1818
| **Mandatory run variables** | `sources`: A list of paths or binary streams that you want to transcribe |
1919
| **Output variables** | `documents`: A list of documents |
20-
| **API reference** | [Audio](/reference/audio-api) |
21-
| **GitHub link** | https://github.com/deepset-ai/haystack/blob/main/haystack/components/audio/whisper_remote.py |
22-
| **Package name** | `haystack-ai` |
20+
| **API reference** | [Whisper](/reference/integrations-whisper) |
21+
| **GitHub link** | https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/whisper |
22+
| **Package name** | `whisper-haystack` |
2323

2424
</div>
2525

2626
## Overview
2727

28+
The `RemoteWhisperTranscriber` is part of the `whisper-haystack` integration package. Install it with:
29+
30+
```python
31+
pip install whisper-haystack
32+
```
33+
2834
`RemoteWhisperTranscriber` works with OpenAI-compatible clients and isn't limited to just OpenAI as a provider. For example, [Groq](https://console.groq.com/docs/speech-text) offers a drop-in replacement that can be used as well. You can set the API key in one of two ways:
2935

3036
1. Through the `api_key` initialization parameter, where the key is resolved using [Secret API](../../concepts/secret-management.mdx).
3137
2. By setting it in the `OPENAI_API_KEY` environment variable, which the system will use to access the key.
3238

3339
```python
34-
from haystack.components.audio import RemoteWhisperTranscriber
40+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber
3541

3642
transcriber = RemoteWhisperTranscriber()
3743
```
@@ -41,7 +47,7 @@ Additionally, the component requires the following parameters to work:
4147
- `model` specifies the Whisper model.
4248
- `api_base_url` specifies the OpenAI base URL and defaults to `"https://api.openai.com/v1"`. If you are using Whisper provider other than OpenAI set this parameter according to provider's documentation.
4349

44-
See other optional parameters in our [API documentation](/reference/audio-api).
50+
See other optional parameters in our [API documentation](/reference/integrations-whisper).
4551

4652
See the [Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper [GitHub repo](https://github.com/openai/whisper) for the supported audio formats and languages.
4753

@@ -53,7 +59,7 @@ Here’s an example of how to use `RemoteWhisperTranscriber` to transcribe a loc
5359

5460
```python
5561
import requests
56-
from haystack.components.audio import RemoteWhisperTranscriber
62+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber
5763

5864
response = requests.get(
5965
"https://ia903102.us.archive.org/19/items/100-Best--Speeches/EK_19690725_64kb.mp3",
@@ -72,7 +78,7 @@ print(transcription["documents"][0].content)
7278
The pipeline below fetches an audio file from a specified URL and transcribes it. It first retrieves the audio file using `LinkContentFetcher`, then transcribes the audio into text with `RemoteWhisperTranscriber`, and finally outputs the transcription text.
7379

7480
```python
75-
from haystack.components.audio import RemoteWhisperTranscriber
81+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber
7682
from haystack.components.fetchers import LinkContentFetcher
7783
from haystack import Pipeline
7884

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
deprecations:
3+
- |
4+
``LocalWhisperTranscriber`` and ``RemoteWhisperTranscriber`` are deprecated and will be removed from
5+
Haystack in version 3.0. They are moving to the ``whisper-haystack`` package. To continue using them,
6+
install the package with ``pip install whisper-haystack`` and update your imports as follows:
7+
8+
.. code-block:: python
9+
10+
from haystack_integrations.components.audio.whisper import LocalWhisperTranscriber
11+
from haystack_integrations.components.audio.whisper import RemoteWhisperTranscriber

0 commit comments

Comments
 (0)