-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: LocalWhisperTranscriber - new devices mgmt (#7008)
* wip * whisper local transcriber: use new device mgmt * better from_dict + test * reno
- Loading branch information
Showing
3 changed files
with
68 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
releasenotes/notes/whisper-loc-new-devices-0665a24cd92ee4b6.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
upgrade: | ||
- | | ||
Adopt the new framework-agnostic device management in Local Whisper Transcriber. | ||
Before this change: | ||
```python | ||
from haystack.components.audio import LocalWhisperTranscriber | ||
transcriber = LocalWhisperTranscriber(device="cuda:0") | ||
``` | ||
After this change: | ||
```python | ||
from haystack.utils.device import ComponentDevice, Device | ||
from haystack.components.audio import LocalWhisperTranscriber | ||
device = ComponentDevice.from_single(Device.gpu(id=0)) | ||
# or | ||
# device = ComponentDevice.from_str("cuda:0") | ||
transcriber = LocalWhisperTranscriber(device=device) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters