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.
A general uplift of the language leap package.
I would highly recommend pulling this branch down and testing locally; and/or if not comfortable merging, I think it would be a good reference to uplifting some areas of the code. I didn't see an area for unit tests but please correct me if I'm wrong 👍
If so, feel free to close the PR as desired, just thought it may help.
Changes include:
environment.py
file for common ENVs and imports.asr.py
module into a helper function. (Both 'transcribe' and 'translate' functions could be replaced with the helper function if desired).As mentioned above, the directory structure for
src/
now looks like:$ tree . └── src ├── language_leap │ ├── asr.py │ ├── audio │ │ └── samples │ │ ├── english_speech_sample.wav │ │ └── japanese_speech_sample.wav │ ├── audio_translate.py │ ├── environment.py │ ├── get_audio_device_ids.py │ ├── __init__.py │ ├── subtitler.py │ ├── tts.py │ ├── voice_translator.py │ └── voicevox.py ├── run_voicevox_colab.ipynb └── run_whisper_colab.ipynb
If at any point in the future you wanted to make this a python package, or cythonize it, you could use this directory structure to manage package imports and/or easily place the package into a docker container during a build process.