A simple tool to make the video, audio, subtitle and video-url (especially youtube) content into a written markdown files with the ability to rewritten the oral expression into written ones, or translating the content into a target language by using LLM.
Initally, this porject is just serving to my website GCDFL. We do a service to turn its lectures into a written files for easier further editing.
Wenbi is a Chinese name 文笔, meaning a good writting.
you can try the demo.
-
100% Open source and totally free of use. I love open source, I learned a lot from it.
-
💯 Accept most popular audio, video, subtitle files and url--mainly using yt-dlp as input.
-
💯 Editing the files by using LLM to rewriting and translating the content into a readable written markdown files.
-
💯 Support input with multiple languages.
-
💯 offer an commandline and gradio GUI with multiple options for further personal settings
-
💯 The support provider is Ollama, you can use most of the models from ollama.
-
🚧 other provider supporting, such as OpenAi, Google and Others.
-
🚧 fine-tuned model for specific job, for example for my personal project from GCDFL, introducing the eastern churches to Chinese audience through academic lectures; CTCFOL, The Chinese Translation of Church Fathers from Original Languages.
- You can install through pip (or other tools as uv or rye) and from source.
- Install Ollama and dowload a model. The default model for this project is qwen2.5.
-for uv: uv venv --python 3.12
uv pip install wenbi
oruv add wenbi
uv add llvmlite numba
, then install wenbi.
After install, you can simply using wenbi commandline. if you want a gradio GUI, you can run wenbi --gui
. the commandline options as follow:
wenbi: Convert video, audio, URL, or subtitle files to CSV and Markdown outputs.
positional arguments:
input Path to input file or URL
options:
-h, --help show this help message and exit
--output-dir OUTPUT_DIR
Output directory (optional)
--gui Launch Gradio GUI
--rewrite-llm REWRITE_LLM
Rewrite LLM model identifier (optional)
--translate-llm TRANSLATE_LLM
Translation LLM model identifier (optional)
--transcribe-lang TRANSCRIBE_LANG
Transcribe language (optional)
--translate-lang TRANSLATE_LANG
Target translation language (default: Chinese)
--rewrite-lang REWRITE_LANG
Target language for rewriting (default: Chinese)
--multi-language Enable multi-language processing
--chunk-length CHUNK_LENGTH
the chunk of Number of sentences per paragraph for llm to tranlsate or rewrite.
(default: 8)
--max-tokens MAX_TOKENS
Maximum tokens for LLM output (default: 50000)
--timeout TIMEOUT LLM request timeout in seconds (default: 3600)
--temperature TEMPERATURE
LLM temperature parameter (default: 0.1)
--base-url BASE_URL Base URL for LLM API (default: http://localhost:11434)
-
install rye
-
git clone https://github.com/Areopaguaworkshop/wenbi.git
cd wenbi
mv pyproject.toml pyproject-bk.toml
rye init
copy whole content of the pyproject-bk.toml into pyproject.toml
source .venv/bin/activate
rye pin 3.12
rye sync
rye add llvmlite numba
, then install wenbi.
- You can choose commandline or webGUI through gradio.
- gradio
python wenbi/main.py
Then go to http://localhost:7860.
- commandline
'python wenbi/cli.py --help'
export HUGGINGFACE_TOKEN="you HUGGINGFACE_TOKEN here"
.
Enjoy!
Buy me a Cofee.
AI-Subtitle-Editor is licensed under the Apache License 2.0 found in the LICENSE file in the root directory of this repository.
title = {wenbi},
author = {Ephrem, Yuan},
year = {2024},
}