Auto translation of new anime episodes based on Yui-MHCP001
Project description
yuisub
Auto translation of new anime episodes based on Yui-MHCP001 LLM
Install
Make sure you have Python >= 3.9 installed on your system
pip install yuisub
If you wanna use the a2t
module, you need to install Whisper
first
# pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install openai-whisper
Command Line Usage
yuisub
can be used from the command line to generate bilingual SRT files. Here's how to use it:
yuisub -h # Displays help message
Library
yuisub
can also be used as a library
Example
from yuisub import bilingual, from_file
from yuisub.a2t import WhisperModel
# srt from audio
model = WhisperModel(name="medium", device="cuda")
segs = model.transcribe(audio="path/to/audio.mp3")
srt = model.gen_srt(segs)
# srt from file
# srt = from_file("path/to/input.srt")
# Generate bilingual SRT
srt_zh, srt_bilingual = bilingual(
srt=srt,
model="gpt_model_name",
api_key="your_openai_api_key",
base_url="api_url",
bangumi_url="https://bangumi.tv/subject/424883/"
)
# Save the SRT files
srt_zh.save("path/to/output.zh.srt")
srt_bilingual.save("path/to/output.bilingual.srt")
License
This project is licensed under the BSD 3-Clause - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
yuisub-0.0.3-py3-none-any.whl
(20.5 kB
view hashes)