Maysee
Maysee
做了个转译成lrc的python库[openlrc](https://github.com/zh-plus/Open-Lyrics),具体翻译的部分在[这里](https://github.com/zh-plus/Open-Lyrics/blob/d0a0a40fa4216fbe7668a8da171ba76ec1e14b40/openlrc/lrc.py#LL95C14-L95C14),做了结合上下文翻译和异步调用OpenAI API,有需要的可以参考下。
It can be implemented by directly calling the components of openlrc, and there isn't much code: ```python from copy import deepcopy from pathlib import Path from openlrc.opt import SubtitleOptimizer from...
```python from openlrc.subtitle import Subtitle if __name__ == '__main__': lrcer.run("/home/bingo06/AIGC/auto_ai_subtitle/video/output.m4a", src_lang='yue', target_lang='zh-cn', skip_trans=True) subtitle = Subtitle.from_file('/home/bingo06/AIGC/auto_ai_subtitle/video/output.lrc') subtitle.to_srt() ``` You can convert the format yourself. Note that if the audio length...
Replace `https://api.g4f.icu` with `https://api.g4f.icu/v1` to fix the issue.
The request for anthropic models to g4f.icu should also be routed through the OpenAI SDK. I'm still looking for an appropriate solution.
Install the lastest version from github: `pip install git+https://github.com/zh-plus/openlrc` and route claude model into OpenAI SDK by `chatbot_model='openai: claude-3-haiku-20240307'` Example: ```python lrcer = LRCer(chatbot_model='openai: claude-3-haiku-20240307', base_url_config={'openai': 'https://api.g4f.icu/v1/'}) ```
We can now use the DeepSeek model, as it offers an OpenAI-compatible API. ```python lrcer = LRCer(chatbot_model='openai: deepseek-chat', base_url_config={'openai': 'https://api.deepseek.com'}) ``` Remember to change your `OPENAI_API_KEY` value to the provided...
Will be fixed in the next minor version.
Now openlrc depends on a [specific commit](https://github.com/SYSTRAN/faster-whisper/commit/d57c5b40b06e59ec44240d93485a95799548af50) of faster-whisper, which is not published on PyPI. Install it from source: pip install "faster-whisper @ https://github.com/SYSTRAN/fasterwhisper/archive/d57c5b40b06e59ec44240d93485a95799548af50.tar.gz"
I'm working on refactoring the intermediate file generation process, which is currently buggy and poorly structured. During the refactor: 1. I will maintain the lazy generation strategy. The project's time...