-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add step to whisperx role to cache models required for transcription #1607
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aed57a7
Add script to download whisperx models
philmcmahon cadb300
Remove steps to install/uninstall typer and hf hub as these are inclu…
philmcmahon 33cb5d0
Run download as ubuntu user
philmcmahon 628acc1
Remove torchvision from whisperx role
philmcmahon 8864486
Parameterise whisperx pip install candiate
philmcmahon 68f6a49
Fetch script from s3 instead of github
philmcmahon 9e22529
Use aws cli to fetch model download script
philmcmahon f95e4d3
document model download steps
philmcmahon 9778014
Only have one parameter for model stage
philmcmahon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
model_script_stage: PROD |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
dependencies: | ||
- pip3 | ||
- aws-tools | ||
- role: packages | ||
packages: | ||
- ffmpeg |
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 |
---|---|---|
|
@@ -9,13 +9,26 @@ | |
pip: | ||
name: | ||
- torch==2.0.0 | ||
- torchvision==0.15.1 | ||
- torchaudio==2.0.1 | ||
executable: pip3 | ||
extra_args: "--index-url https://download.pytorch.org/whl/cu118" | ||
|
||
- name: Install whisperx | ||
pip: | ||
name: whisperx | ||
name: "{{ whisperx_package | default('whisperx') }}" | ||
executable: pip3 | ||
|
||
# We use a python script to fetch the models which is owned by the transcription service. See the below PRs for details: | ||
# - https://github.com/guardian/amigo/pull/1607 | ||
# - https://github.com/guardian/transcription-service/pull/130 | ||
- name: Download models script | ||
shell: | | ||
aws --quiet s3 cp s3://amigo-data-{{ model_script_stage.lower() }}/deploy/{{ model_script_stage }}/whisperx-model-fetch/download_whisperx_models.py /tmp/download_whisperx_models.py | ||
exit 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this |
||
|
||
# The script lives here https://github.com/guardian/transcription-service/blob/main/whisperx-model-fetch/download_whisperx_models.py | ||
# If you are changing these parameters it may be helpful to run it locally to test the changes. | ||
- name: Download whisperx models | ||
command: "python3 /tmp/download_whisperx_models.py --whisper-models --diarization-models --torch-align-models --huggingface-token {{ huggingface_token }}" | ||
become: yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
become_user: ubuntu |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make the bucket a parameter too? Interestingly, the
cdk-base
role uses a bucket w/out the stage suffix.