zh-plus / openlrc

Transcribe and translate voice into LRC file using Whisper and LLMs (GPT, Claude, et,al). 使用whisper和LLM(GPT,Claude等)来转录、翻译你的音频为字幕文件。
https://zh-plus.github.io/openlrc/
MIT License
449 stars 32 forks source link

Transcribed subtitle file paths are not returned when skip_trans=True is specified #54

Closed MaleicAcid closed 1 month ago

MaleicAcid commented 2 months ago

For those who use GPU computing power on the cloud, they usually choose to run the transcription task separately first. But currently, when skip_trans=Ture is enabled in openlrc, the path of transcribed subtitle files will not be returned. https://github.com/zh-plus/openlrc/blob/d55fb5b70ccbdaa073012c2c3e30234616e374ae/openlrc/openlrc.py#L193-L219

 [2024-08-18 22:14:37] INFO     [ThreadPoolExecutor-1_1] Optimized json file saved to /data/jid-4qk9Ku89-data/home/user00/gitspace/video_tools/data/preprocessed/1. Section 2_Introduction_preprocessed_transcribed_optimized.json
 [2024-08-18 22:14:37] INFO     [ThreadPoolExecutor-1_1] File saved to /data/jid-4qk9Ku89-data/home/user00/gitspace/video_tools/data/preprocessed/1. Section 2_Introduction_preprocessed.srt
...
2024-08-18 22:14:37.817 | INFO     | transcriber:invoke:73 - transcribe end, result: []

Another hope is that openlrc can provide a separate translation module that does not rely on pytorch. I built a translation application with this issue and compiled it using nuitka. I found that it still requires pytorch to be compiled to run, although this seems unnecessary. https://github.com/zh-plus/openlrc/blob/d55fb5b70ccbdaa073012c2c3e30234616e374ae/openlrc/utils.py#L17

zh-plus commented 2 months ago

For those who use GPU computing power on the cloud, they usually choose to run the transcription task separately first. But currently, when skip_trans=Ture is enabled in openlrc, the path of transcribed subtitle files will not be returned.

I will fix it soon in the next minor version.

Another hope is that openlrc can provide a separate translation module that does not rely on pytorch. I built a translation application with this https://github.com/zh-plus/openlrc/issues/34and compiled it using nuitka. I found that it still requires pytorch to be compiled to run, although this seems unnecessary.

I have looked into solutions that would enable users to install only the translation-related dependencies using pip install openlrc[trans]. However, openlrc[trans] in Poetry installs additional dependencies rather than entirely different ones (see Poetry documentation). If I classify PyTorch-related dependencies as "extras," it could confuse regular users who want both transcription and translation features.

I'm still exploring other options. Any recommendations would be appreciated.

MaleicAcid commented 2 months ago

For those who use GPU computing power on the cloud, they usually choose to run the transcription task separately first. But currently, when skip_trans=Ture is enabled in openlrc, the path of transcribed subtitle files will not be returned.

I will fix it soon in the next minor version.

Another hope is that openlrc can provide a separate translation module that does not rely on pytorch. I built a translation application with this https://github.com/zh-plus/openlrc/issues/34and compiled it using nuitka. I found that it still requires pytorch to be compiled to run, although this seems unnecessary.

I have looked into solutions that would enable users to install only the translation-related dependencies using pip install openlrc[trans]. However, openlrc[trans] in Poetry installs additional dependencies rather than entirely different ones (see Poetry documentation). If I classify PyTorch-related dependencies as "extras," it could confuse regular users who want both transcription and translation features.

I'm still exploring other options. Any recommendations would be appreciated.

Is it possible to provide different version of python packages just like:

# A and B are two completely independent packages
torch==2.2.2+cu121(openlrc==1.5.0+full)
torch==2.2.2+cpu(openlrc==1.5.0+translate-only)

people who install openlrc==1.5.0+translate-only can run translation task without pytorch.

or

# package B,C depend on A
torch==2.2.2(openlrc-base==1.5.0)
torchaudio==2.2.2(openlrc-translate==1.5.0)
torchvision==1.7.0(openlrc-transcribe==1.5.0)

people who install openlrc-base and openlrc-transcribe can run translation task without pytorch.

zh-plus commented 1 month ago

Fixed in v1.5.2