-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat: Replace torchaudio with pydub #381
base: master
Are you sure you want to change the base?
feat: Replace torchaudio with pydub #381
Conversation
refactor: Removed unnecessary dependencies Removed Requirements - python-dateutil - tiktoken - torchaudio - scipy - tokenizers - huggingface-hub - sentence-transformers - optimum[onnxruntime] Major Changes in This Commit - torchaudio to pydub - bolna/helpers/utils.py - save_audio_file_to_s3 - resample - pcm_to_wav_bytes - wav_bytes_to_pcm - bolna/synthesizer/basesynthesizer - resample - sklearn to np - bolna/memory/cache/vector_cache - __get_top_cosine_similarity_doc
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.
The tricky part for me was
def save_audio_file_to_s3
...
First I had to understand what it does.
Also had to spend hours trying to decode input message (only to find it's file format as webm and not wav).
Testing for this function was very hard as I'm not able to run the "default" handler as I lack some client code. Tried it with daily and by passing custom data to function.
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.
I've tried and tested it.
If you want to Test it before Merging the PR
Then you'll have to make a fork and make a change in bolna_server.Dockerfile
FROM python:3.10.13-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 \
git \
ffmpeg
# NOTE: Change the username and repo name to your fork
RUN --mount=type=cache,target=/root/.cache/pip \
pip install git+https://github.com/<your-username>/<your-fork-bolna>@master
COPY quickstart_server.py /app/
EXPOSE 5001
CMD ["uvicorn", "quickstart_server:app", "--host", "0.0.0.0", "--port", "5001"]
This step is required to rebuild image.
After building Image |
As mentioned in #380 by @marmikcfc
Updated resampling with soxr, ensuring no increased latency, good quality, reduced docker image size (1.22 GB).
|
This PR closes #370
This PR closes #380
feat: Replace torchaudio with pydub
refactor: Removed unnecessary dependencies
Removed Requirements
Major Changes in This Commit
Issue #370 closes as we are replacing both scipy and torchaudio with pydub