Skip to content
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

Install dependencies with uv #81

Merged
merged 1 commit into from
Feb 3, 2025
Merged

Install dependencies with uv #81

merged 1 commit into from
Feb 3, 2025

Conversation

edsu
Copy link
Contributor

@edsu edsu commented Jan 31, 2025

Note: it looks like A LOT of files have changed, but you can ignore the majority of them in docs/reports and docs/baseline which are the output of running a benchmark.


We've been installing Python dependencies with Pip, and not tracking their versions. Since we've started using uv in some other infrastructure team Python projects it makes sense to add here so that speech-to-text can be tracked by infra-team's weekly dependency update process.

Unlike pip, uv always installs system specific Python wheels. There wasn't a wheel available for triton (an openai-whisper's dependency) under Python3.8 so the installation of dependencies failed.

So, in addition to adding uv this PR also upgrades our base Docker image from nvidia/cuda:12.1.0-devel-ubuntu20.04 to nvidia/cuda:12.8.0-cudnn-devel-ubuntu22.04 which allows us to install python3.10 when we apt install python3.

Since this could significantly change Whisper's behavior I wanted to be able to compare the VTT transcript output before and after the Docker image change. I added the start of a benchmarking system that will allow us to compare the output of a set of 22 SDR items, with a previous benchmark. Ideally this benchmark would be human vetted, and actually represent a ground truth for what we believe the transcript should be. But for the time being it is simply a snapshot in time of what the transcript looked like today. See the benchmark/README.md file for details.

Closes #80
Refs #65

@edsu edsu marked this pull request as draft January 31, 2025 15:15
@edsu edsu force-pushed the uv branch 3 times, most recently from 6946ed7 to e2553aa Compare January 31, 2025 15:26
@edsu edsu force-pushed the uv branch 15 times, most recently from 5b0e19e to 49950f8 Compare January 31, 2025 23:57
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for Jenkins when it runs dependency updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to run tests using uv now.

Dockerfile Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to running with uv, and a notable change to the base Docker image to get Python3.10 so we can manage Whisper dependencies with uv.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation for the benchmarking process. You can ignore the output files below.

docs/report.py Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a program for generating a report using the baseline transcripts and the latest transcripts in the SDR.

Copy link
Member

@jmartin-sul jmartin-sul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple small suggestions and needs a rebase, but looks great!

docs/README.md Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
We've been installing Python dependencies with Pip, and not tracking
their versions. Since we've started using uv in some other
infrastructure team Python projects it makes sense to add here so that
speech-to-text can be tracked by infra-team's weekly dependency update
process.

Unlike pip, uv always installs system specific Python wheels. There
wasn't a wheel available for triton (an openai-whisper's dependency)
under Python3.8 so the installation of dependencies failed.

So, in addition to adding uv this PR also upgrades our base Docker image
from `nvidia/cuda:12.1.0-devel-ubuntu20.04` to
`nvidia/cuda:12.8.0-cudnn-devel-ubuntu22.04` which allows us to install
python3.10 when we `apt install python3`.

Since this significantly change Whisper's behavior I wanted to be able to
compare the VTT transcript output before and after the Docker image
change. I added the start of a benchmarking system that will allow us to
compare the output of a set of 22 SDR items, with a previous benchmark.
Ideally this benchmark would be human vetted, and actually represent a
ground truth for what we believe the transcript should be. But for the
time being it is simply a snapshot in time of what the transcript looked
like today. See the benchmark/README.md file for details.

Closes #80
Refs #65
@edsu edsu marked this pull request as ready for review February 3, 2025 23:18
@edsu edsu merged commit 65e6100 into main Feb 3, 2025
3 checks passed
@edsu edsu deleted the uv branch February 3, 2025 23:24
jmartin-sul added a commit to sul-dlss/access-update-scripts that referenced this pull request Feb 7, 2025
it's a python project, but the update hook was already added in sul-dlss/speech-to-text#81

closes sul-dlss/speech-to-text#65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Python dependency management with uv
2 participants