| | |
| | |
| |
|
| | SHELL := /bin/bash |
| | PYTHON := python3 |
| | UV := uv |
| | VENV := .venv |
| | MODEL_DIR := ./models |
| |
|
| | .PHONY: all install dev clean test lint format serve train download help |
| |
|
| | all: install download |
| |
|
| | |
| |
|
| | install: venv |
| | $(UV) pip install -e . |
| |
|
| | dev: venv |
| | $(UV) pip install -e ".[all]" |
| | $(UV) pip install git+https://github.com/huggingface/transformers |
| |
|
| | venv: |
| | $(UV) venv $(VENV) |
| | @echo "Virtual environment created at $(VENV)" |
| | @echo "Activate with: source $(VENV)/bin/activate" |
| |
|
| | |
| |
|
| | download: download-qwen3-omni download-cosyvoice download-wav2lip |
| |
|
| | download-qwen3-omni: |
| | @echo "Downloading Qwen3-Omni-30B-A3B-Instruct..." |
| | $(UV) run hf download Qwen/Qwen3-Omni-30B-A3B-Instruct --local-dir $(MODEL_DIR)/qwen3-omni |
| |
|
| | download-cosyvoice: |
| | @echo "Downloading CosyVoice 2.0..." |
| | $(UV) run hf download FunAudioLLM/CosyVoice2-0.5B --local-dir $(MODEL_DIR)/cosyvoice |
| |
|
| | download-wav2lip: |
| | @echo "Downloading Wav2Lip..." |
| | $(UV) run hf download numz/wav2lip_studio --local-dir $(MODEL_DIR)/wav2lip |
| |
|
| | download-quantized: |
| | @echo "Downloading quantized Qwen3-Omni AWQ..." |
| | $(UV) run hf download cpatonn/Qwen3-Omni-30B-A3B-Instruct-AWQ-4bit --local-dir $(MODEL_DIR)/qwen3-omni-4bit |
| |
|
| | |
| |
|
| | serve: |
| | $(UV) run zen-serve --host 0.0.0.0 --port 8000 |
| |
|
| | serve-dev: |
| | $(UV) run zen-serve --host 0.0.0.0 --port 8000 --reload |
| |
|
| | translate: |
| | $(UV) run zen-translate $(FILE) -o output.mp4 |
| |
|
| | |
| |
|
| | train-identity: |
| | $(UV) run zen-translate train --type identity --output ./outputs/identity |
| |
|
| | train-anchor: |
| | $(UV) run zen-translate train --type anchor --output ./outputs/anchor |
| |
|
| | dataset-build: |
| | $(UV) run zen-translate dataset build --output ./data/news_anchors --channels cnn,bbc,nhk,dw |
| |
|
| | dataset-list: |
| | $(UV) run zen-translate dataset list |
| |
|
| | swift-train: |
| | swift sft --config ./outputs/identity/train_config.yaml |
| |
|
| | |
| |
|
| | test: |
| | $(UV) run pytest tests/ -v --cov=zen_translator |
| |
|
| | lint: |
| | $(UV) run ruff check src/ tests/ |
| |
|
| | format: |
| | $(UV) run ruff format src/ tests/ |
| |
|
| | typecheck: |
| | $(UV) run mypy src/ |
| |
|
| | |
| |
|
| | docker-build: |
| | docker build -t zenlm/zen-translator:latest . |
| |
|
| | docker-run: |
| | docker run -p 8000:8000 --gpus all zenlm/zen-translator:latest |
| |
|
| | |
| |
|
| | clean: |
| | rm -rf build/ dist/ *.egg-info |
| | find . -type d -name __pycache__ -exec rm -rf {} + |
| | find . -type f -name "*.pyc" -delete |
| |
|
| | clean-models: |
| | rm -rf $(MODEL_DIR)/* |
| |
|
| | clean-all: clean clean-models |
| | rm -rf $(VENV) |
| |
|
| | |
| |
|
| | help: |
| | @grep -E '^[a-zA-Z_-]+:.*? |
| |
|
| | |
| | .DEFAULT_GOAL := help |
| |
|