Mercurial
comparison dictation/BUILD @ 275:78699f810817
Add Qwen3-VL and WebRTC dictation services
Add Bazel targets for the CUDA-backed Qwen3-VL server and a local WebRTC faster-whisper dictation service.
Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3d8cb06-6c95-4ae0-9757-651d3796ab00
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 17 Aug 2026 10:58:47 -0700 |
| parents | |
| children | 49e9e591c9bb |
comparison
equal
deleted
inserted
replaced
| 274:c9be578316a6 | 275:78699f810817 |
|---|---|
| 1 load("@dictation_pip//:requirements.bzl", "requirement") | |
| 2 load("@rules_python//python:pip.bzl", "compile_pip_requirements") | |
| 3 load("@rules_python//python:py_binary.bzl", "py_binary") | |
| 4 load("@rules_python//python:py_library.bzl", "py_library") | |
| 5 load("@rules_python//python:py_test.bzl", "py_test") | |
| 6 load("@rules_shell//shell:sh_binary.bzl", "sh_binary") | |
| 7 | |
| 8 compile_pip_requirements( | |
| 9 name = "requirements", | |
| 10 src = "requirements.in", | |
| 11 extra_args = ["--allow-unsafe"], | |
| 12 requirements_txt = "requirements_lock.txt", | |
| 13 ) | |
| 14 | |
| 15 py_library( | |
| 16 name = "dictation_lib", | |
| 17 srcs = [ | |
| 18 "__init__.py", | |
| 19 "audio.py", | |
| 20 "config.py", | |
| 21 "server.py", | |
| 22 "session.py", | |
| 23 "transcriber.py", | |
| 24 ], | |
| 25 data = glob(["web/**"]), | |
| 26 deps = [ | |
| 27 requirement("aiortc"), | |
| 28 requirement("av"), | |
| 29 requirement("fastapi"), | |
| 30 requirement("faster-whisper"), | |
| 31 requirement("huggingface-hub"), | |
| 32 requirement("numpy"), | |
| 33 requirement("uvicorn"), | |
| 34 ], | |
| 35 ) | |
| 36 | |
| 37 py_binary( | |
| 38 name = "dictation_bin", | |
| 39 srcs = ["main.py"], | |
| 40 data = glob(["web/**"]), | |
| 41 main = "main.py", | |
| 42 deps = [ | |
| 43 ":dictation_lib", | |
| 44 requirement("ctranslate2"), | |
| 45 requirement("nvidia-cublas-cu12"), | |
| 46 requirement("nvidia-cudnn-cu12"), | |
| 47 ], | |
| 48 ) | |
| 49 | |
| 50 py_binary( | |
| 51 name = "webrtc_smoke", | |
| 52 srcs = ["webrtc_smoke.py"], | |
| 53 main = "webrtc_smoke.py", | |
| 54 deps = [ | |
| 55 requirement("aiortc"), | |
| 56 requirement("httpx"), | |
| 57 ], | |
| 58 ) | |
| 59 | |
| 60 [ | |
| 61 sh_binary( | |
| 62 name = command, | |
| 63 srcs = ["launcher.sh"], | |
| 64 args = [ | |
| 65 "$(rootpath :dictation_bin)", | |
| 66 command, | |
| 67 ], | |
| 68 data = [ | |
| 69 ":dictation_bin", | |
| 70 requirement("nvidia-cublas-cu12"), | |
| 71 requirement("nvidia-cudnn-cu12"), | |
| 72 ], | |
| 73 ) | |
| 74 for command in [ | |
| 75 "server", | |
| 76 "preflight", | |
| 77 "download_model", | |
| 78 "transcribe", | |
| 79 ] | |
| 80 ] | |
| 81 | |
| 82 py_test( | |
| 83 name = "audio_test", | |
| 84 srcs = ["audio_test.py"], | |
| 85 deps = [ | |
| 86 ":dictation_lib", | |
| 87 requirement("numpy"), | |
| 88 ], | |
| 89 ) | |
| 90 | |
| 91 py_test( | |
| 92 name = "config_test", | |
| 93 srcs = ["config_test.py"], | |
| 94 deps = [":dictation_lib"], | |
| 95 ) | |
| 96 | |
| 97 py_test( | |
| 98 name = "server_test", | |
| 99 srcs = ["server_test.py"], | |
| 100 data = glob(["web/**"]), | |
| 101 deps = [ | |
| 102 ":dictation_lib", | |
| 103 requirement("httpx"), | |
| 104 ], | |
| 105 ) | |
| 106 | |
| 107 py_test( | |
| 108 name = "webrtc_test", | |
| 109 srcs = ["webrtc_test.py"], | |
| 110 deps = [ | |
| 111 ":dictation_lib", | |
| 112 requirement("aiortc"), | |
| 113 requirement("av"), | |
| 114 requirement("numpy"), | |
| 115 ], | |
| 116 ) | |
| 117 | |
| 118 test_suite( | |
| 119 name = "all_tests", | |
| 120 tests = [ | |
| 121 ":audio_test", | |
| 122 ":config_test", | |
| 123 ":server_test", | |
| 124 ":webrtc_test", | |
| 125 ], | |
| 126 ) |