{"id":636,"date":"2026-08-05T21:48:54","date_gmt":"2026-08-05T13:48:54","guid":{"rendered":"http:\/\/nelliemylove.cn\/nelliemylove\/?p=636"},"modified":"2026-08-09T14:10:55","modified_gmt":"2026-08-09T06:10:55","slug":"local-rtx3080-asr","status":"publish","type":"post","link":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/2026\/08\/05\/local-rtx3080-asr\/","title":{"rendered":"\u672c\u5730RTX3080\u90e8\u7f72\u8bed\u97f3\u8f6c\u6587\u5b57\u5e94\u7528"},"content":{"rendered":"<h2>ASR \u8bed\u97f3\u8f6c\u6587\u5b57\u5e94\u7528 \u00b7 \u5b89\u88c5\u90e8\u7f72\u624b\u518c<\/h2>\n<h2>\u4e00\u3001\u7cfb\u7edf\u8981\u6c42<\/h2>\n<figure class=\"wp-block-table\">\n<table class=\"cp-md-table\">\n<thead>\n<tr>\n<th>\u9879\u76ee<\/th>\n<th>\u8981\u6c42<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u64cd\u4f5c\u7cfb\u7edf<\/td>\n<td>Linux x86_64\uff08Ubuntu 22.04+ \/ WSL2 \u5747\u53ef\uff09<\/td>\n<\/tr>\n<tr>\n<td>GPU<\/td>\n<td>NVIDIA GPU\uff0cCompute Capability \u2265 7.0\uff08\u63a8\u8350 Ampere\/Ada Lovelace\uff09<\/td>\n<\/tr>\n<tr>\n<td>NVIDIA \u9a71\u52a8<\/td>\n<td>\u2265 525.x\uff08\u652f\u6301 CUDA 12.4\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u663e\u5b58<\/td>\n<td>\u2265 4GB\uff08large-v3-turbo + pyannote \u540c\u65f6\u52a0\u8f7d\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58<\/td>\n<td>\u2265 8GB<\/td>\n<\/tr>\n<tr>\n<td>\u78c1\u76d8<\/td>\n<td>\u2265 5GB\uff08\u6a21\u578b\u7f13\u5b58 + conda \u73af\u5883\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u672c\u624b\u518c\u4ee5 <strong>Ubuntu + NVIDIA RTX 3080<\/strong> \u4e3a\u4f8b\u3002<\/p>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u4e8c\u3001\u5b89\u88c5\u7cfb\u7edf\u4f9d\u8d56<\/h2>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u66f4\u65b0\u7cfb\u7edf\r\nsudo apt update &amp;&amp; sudo apt upgrade -y\r\n\r\n# \u5b89\u88c5 ffmpeg\uff08\u97f3\u9891\u5904\u7406\uff09\u548c\u57fa\u7840\u5de5\u5177\r\nsudo apt install -y ffmpeg build-essential curl wget git\r\n\r\n# \u9a8c\u8bc1\r\nffmpeg -version | head -1\r\nnvidia-smi<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u4e09\u3001\u5b89\u88c5 Miniconda<\/h2>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u4e0b\u8f7d\u5e76\u5b89\u88c5 Miniconda\r\nwget https:\/\/repo.anaconda.com\/miniconda\/Miniconda3-latest-Linux-x86_64.sh -O \/tmp\/miniconda.sh\r\nbash \/tmp\/miniconda.sh -b -p $HOME\/miniconda3\r\n\r\n# \u521d\u59cb\u5316 conda\r\n$HOME\/miniconda3\/bin\/conda init bash\r\nsource ~\/.bashrc\r\n\r\n# \u9a8c\u8bc1\r\nconda --version<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u56db\u3001\u521b\u5efa Python 3.12 \u865a\u62df\u73af\u5883<\/h2>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u521b\u5efa\u73af\u5883\uff08\u4f7f\u7528 conda-forge \u9891\u9053\uff0c\u907f\u514d MKL \u4f9d\u8d56\u95ee\u9898\uff09\r\nconda create -n asr python=3.12 -c conda-forge --no-default-packages -y\r\n\r\n# \u6fc0\u6d3b\u73af\u5883\r\nconda activate asr\r\n\r\n# \u9a8c\u8bc1\r\npython --version  # \u5e94\u8f93\u51fa Python 3.12.x<\/code><\/pre>\n<blockquote class=\"wp-block-quote\">\n<p><strong>\u4e3a\u4ec0\u4e48\u7528 Python 3.12\uff1f<\/strong> PyTorch cu124 \u5b98\u65b9\u63d0\u4f9b cp312 \u9884\u7f16\u8bd1 wheel\uff0cPython 3.14 \u7b49\u8fc7\u65b0\u7248\u672c\u65e0\u5bf9\u5e94 wheel\u3002<\/p>\n<\/blockquote>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u4e94\u3001\u5b89\u88c5 PyTorch\uff08CUDA 12.4\uff09<\/h2>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u5b89\u88c5 PyTorch + torchaudio\uff08CUDA 12.4 \u7248\u672c\uff09\r\npip install torch==2.6.0 torchaudio==2.6.0 \r\n    --index-url https:\/\/download.pytorch.org\/whl\/cu124\r\n\r\n# \u9a8c\u8bc1 CUDA \u53ef\u7528\r\npython -c &quot;import torch; print(f&#x27;torch={torch.__version__}, cuda={torch.cuda.is_available()}, device={torch.cuda.get_device_name(0)}&#x27;)&quot;\r\n# \u5e94\u8f93\u51fa: torch=2.6.0+cu124, cuda=True, device=NVIDIA GeForce RTX 3080<\/code><\/pre>\n<blockquote class=\"wp-block-quote\">\n<p><strong>\u5982\u679c PyPI \u4e0b\u8f7d\u6162<\/strong>\uff0c\u53ef\u4f7f\u7528\u56fd\u5185\u955c\u50cf\uff1a<br \/>&#8220;`bash<br \/>pip install torch==2.6.0 torchaudio==2.6.0 <br \/>&#8211;index-url https:\/\/download.pytorch.org\/whl\/cu124 <br \/>-i https:\/\/mirrors.aliyun.com\/pypi\/simple\/ &#8211;trusted-host mirrors.aliyun.com<br \/>&#8220;`<\/p>\n<\/blockquote>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u516d\u3001\u5b89\u88c5 ASR \u4e0e\u8bf4\u8bdd\u4eba\u5206\u79bb\u4f9d\u8d56<\/h2>\n<h3>6.1 \u901a\u8fc7 conda-forge \u5b89\u88c5\uff08\u907f\u514d\u7f16\u8bd1\u95ee\u9898\uff09<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">conda install -c conda-forge -y \r\n    numpy scipy pandas scikit-learn \r\n    requests safetensors \r\n    av soundfile \r\n    einops optuna \r\n    tokenizers huggingface-hub \r\n    starlette pydantic<\/code><\/pre>\n<h3>6.2 \u901a\u8fc7 pip \u5b89\u88c5\u6838\u5fc3\u5305<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u4f7f\u7528\u963f\u91cc\u4e91\u955c\u50cf\u52a0\u901f\uff08pypi.org \u5728\u56fd\u5185\u53ef\u80fd\u8d85\u65f6\uff09\r\nPIP_MIRROR=&quot;-i https:\/\/mirrors.aliyun.com\/pypi\/simple\/ --trusted-host mirrors.aliyun.com&quot;\r\n\r\n# CTranslate2\uff08faster-whisper \u540e\u7aef\uff0c\u5fc5\u987b\u7528 pip \u7248\u672c\u4ee5\u652f\u6301 Ampere GPU kernel\uff09\r\npip install --no-deps ctranslate2 $PIP_MIRROR\r\n\r\n# faster-whisper\r\npip install --no-deps faster-whisper $PIP_MIRROR\r\n\r\n# onnxruntime\uff08VAD \u9759\u97f3\u68c0\u6d4b\u7528\uff09\r\npip install onnxruntime $PIP_MIRROR\r\n\r\n# FastAPI \u76f8\u5173\r\npip install --no-deps fastapi uvicorn python-multipart aiofiles annotated-doc $PIP_MIRROR\r\n\r\n# pyannote \u7cfb\u5217\r\npip install --no-deps \r\n    pyannote.audio pyannote.core pyannote.database \r\n    pyannote.metrics pyannote.pipeline $PIP_MIRROR\r\n\r\n# pyannote \u7684\u4f9d\u8d56\r\npip install --no-deps \r\n    lightning lightning-utilities torchmetrics \r\n    torch-audiomentations torch-pitch-shift \r\n    julius primePy asteroid-filterbanks \r\n    omegaconf antlr4-python3-runtime $PIP_MIRROR\r\n\r\n# OpenTelemetry\uff08pyannote \u9065\u6d4b\u7528\uff09\r\npip install --no-deps \r\n    opentelemetry-api opentelemetry-sdk \r\n    opentelemetry-exporter-otlp-proto-http \r\n    opentelemetry-exporter-otlp-proto-common \r\n    opentelemetry-semantic-conventions $PIP_MIRROR\r\npip install opentelemetry-exporter-otlp-proto-http $PIP_MIRROR\r\n\r\n# sortedcontainers\r\npip install sortedcontainers $PIP_MIRROR<\/code><\/pre>\n<h3>6.3 \u9a8c\u8bc1\u6240\u6709\u6a21\u5757\u53ef\u5bfc\u5165<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">python -c &quot;\r\nimport torch; print(f&#x27;torch={torch.__version__}, cuda={torch.cuda.is_available()}&#x27;)\r\nimport faster_whisper; print(&#x27;faster_whisper OK&#x27;)\r\nimport pyannote.audio; print(&#x27;pyannote.audio OK&#x27;)\r\nimport soundfile; print(&#x27;soundfile OK&#x27;)\r\nimport fastapi; print(&#x27;fastapi OK&#x27;)\r\nimport uvicorn; print(&#x27;uvicorn OK&#x27;)\r\nimport onnxruntime; print(&#x27;onnxruntime OK&#x27;)\r\n&quot;<\/code><\/pre>\n<blockquote class=\"wp-block-quote\">\n<p><strong>\u5e38\u89c1\u95ee\u9898\uff1a<\/strong><br \/>&#8211; <code class=\"wp-code-inline\">undefined symbol: iJIT_NotifyEvent<\/code> \u2192 conda \u5b89\u88c5\u4e86 MKL \u7248 numpy\uff0c\u7528 <code class=\"wp-code-inline\">conda install -c conda-forge nomkl -y<\/code> \u5207\u6362\u4e3a OpenBLAS<br \/>&#8211; <code class=\"wp-code-inline\">cudaErrorNoKernelImageForDevice<\/code> \u2192 conda \u7248 ctranslate2 \u7f3a\u5c11 Ampere kernel\uff0c\u6539\u7528 <code class=\"wp-code-inline\">pip install ctranslate2<\/code><br \/>&#8211; <code class=\"wp-code-inline\">No module named &#x27;xxx&#x27;<\/code> \u2192 pyannote \u4f9d\u8d56\u94fe\u6df1\uff0c\u6309\u62a5\u9519\u9010\u4e2a <code class=\"wp-code-inline\">pip install --no-deps xxx<\/code><\/p>\n<\/blockquote>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u4e03\u3001\u914d\u7f6e HuggingFace Token<\/h2>\n<p>pyannote \u7684\u6a21\u578b\u662f gated\uff08\u9700\u540c\u610f\u534f\u8bae\uff09\uff0c\u9700\u8981 HuggingFace Token\uff1a<\/p>\n<p>1. \u6ce8\u518c [huggingface.co](https:\/\/huggingface.co) \u8d26\u53f7 2. \u8bbf\u95ee\u4ee5\u4e0b\u4e09\u4e2a\u6a21\u578b\u9875\u9762\u5e76\u540c\u610f\u534f\u8bae\uff1a<\/p>\n<ul>\n<li>https:\/\/huggingface.co\/pyannote\/speaker-diarization-3.1<\/li>\n<\/ul>\n<p>3. \u5728 https:\/\/huggingface.co\/settings\/tokens \u521b\u5efa Access Token<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff08\u5199\u5165 ~\/.bashrc \u6301\u4e45\u5316\uff09\r\necho &#x27;export HF_TOKEN=&quot;hf_\u4f60\u7684token&quot;&#x27; &gt;&gt; ~\/.bashrc\r\nsource ~\/.bashrc<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u516b\u3001\u90e8\u7f72\u5e94\u7528\u4ee3\u7801<\/h2>\n<h3>8.1 \u521b\u5efa\u9879\u76ee\u76ee\u5f55<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">mkdir -p ~\/asr-web\/static\r\ncd ~\/asr-web<\/code><\/pre>\n<h3>8.2 \u540e\u7aef\u4ee3\u7801 <code class=\"wp-code-inline\">main.py<\/code><\/h3>\n<p>\u5c06\u9879\u76ee\u4e2d\u7684 <code class=\"wp-code-inline\">main.py<\/code> \u590d\u5236\u5230 <code class=\"wp-code-inline\">~\/asr-web\/main.py<\/code>\u3002<\/p>\n<p>\u5173\u952e\u914d\u7f6e\u9879\uff08\u5728\u6587\u4ef6\u9876\u90e8\uff09\uff1a<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-python\">MODEL_NAME = &quot;large-v3-turbo&quot;              # ASR \u6a21\u578b\r\nMODEL_ROOT = &quot;\/home\/antares\/asr-web\/models&quot; # \u6a21\u578b\u7f13\u5b58\u76ee\u5f55\r\nHF_TOKEN = os.environ.get(&quot;HF_TOKEN&quot;, &quot;&quot;)   # HuggingFace Token<\/code><\/pre>\n<h3>8.3 \u524d\u7aef\u4ee3\u7801 <code class=\"wp-code-inline\">static\/index.html<\/code><\/h3>\n<p>\u5c06\u9879\u76ee\u4e2d\u7684 <code class=\"wp-code-inline\">static\/index.html<\/code> \u590d\u5236\u5230 <code class=\"wp-code-inline\">~\/asr-web\/static\/index.html<\/code>\u3002<\/p>\n<h3>8.4 \u76ee\u5f55\u7ed3\u6784<\/h3>\n<pre class=\"wp-block-code\"><code>~\/asr-web\/\r\n\u251c\u2500\u2500 main.py              # FastAPI \u540e\u7aef\r\n\u251c\u2500\u2500 static\/\r\n\u2502   \u2514\u2500\u2500 index.html       # \u524d\u7aef\u5355\u9875\r\n\u2514\u2500\u2500 models\/              # \u6a21\u578b\u7f13\u5b58\uff08\u81ea\u52a8\u4e0b\u8f7d\uff09\r\n    \u251c\u2500\u2500 models--mobiuslabsgmbh--faster-whisper-large-v3-turbo\/\r\n    \u251c\u2500\u2500 pyannote-diarization-3.1\/\r\n    \u2514\u2500\u2500 pyannote-segmentation-3.0\/<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u4e5d\u3001\u9996\u6b21\u542f\u52a8\uff08\u4e0b\u8f7d\u6a21\u578b\uff09<\/h2>\n<p>\u9996\u6b21\u542f\u52a8\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u6a21\u578b\uff08\u7ea6 1.5GB\uff09\uff0c\u9700\u8981\u914d\u7f6e HF \u955c\u50cf\u52a0\u901f\uff1a<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">cd ~\/asr-web\r\n\r\n# \u56fd\u5185\u7528\u6237\u4f7f\u7528 hf-mirror.com \u955c\u50cf\r\nexport HF_ENDPOINT=https:\/\/hf-mirror.com\r\nexport HF_HUB_DISABLE_XET=1\r\nexport LD_LIBRARY_PATH=$CONDA_PREFIX\/lib:$LD_LIBRARY_PATH\r\n\r\n# \u542f\u52a8\uff08\u9996\u6b21\u4f1a\u4e0b\u8f7d\u6a21\u578b\uff0c\u7ea6 2-5 \u5206\u949f\uff09\r\npython main.py<\/code><\/pre>\n<p>\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\u8868\u793a\u542f\u52a8\u6210\u529f\uff1a<\/p>\n<pre class=\"wp-block-code\"><code>[ASR] \u52a0\u8f7d Whisper \u6a21\u578b large-v3-turbo -&gt; CUDA float16 ...\r\n[ASR] Whisper \u5c31\u7eea\r\n[ASR] \u52a0\u8f7d pyannote\/speaker-diarization-3.1 ...\r\n[ASR] pyannote \u5df2\u79fb\u81f3 GPU: NVIDIA GeForce RTX 3080\r\n[ASR] pyannote \u5c31\u7eea\r\nINFO:     Uvicorn running on http:\/\/0.0.0.0:8000 (Press CTRL+C to quit)<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u5341\u3001\u751f\u4ea7\u73af\u5883\u90e8\u7f72<\/h2>\n<h3>10.1 \u540e\u53f0\u542f\u52a8<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">cd ~\/asr-web\r\n\r\n# \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\r\nexport HF_ENDPOINT=https:\/\/hf-mirror.com\r\nexport HF_HUB_DISABLE_XET=1\r\nexport LD_LIBRARY_PATH=$HOME\/miniconda3\/envs\/asr\/lib:$LD_LIBRARY_PATH\r\n\r\n# \u540e\u53f0\u542f\u52a8\r\nnohup python main.py &gt; \/tmp\/asr_server.log 2&gt;&amp;1 &amp;\r\n\r\n# \u67e5\u770b\u65e5\u5fd7\r\ntail -f \/tmp\/asr_server.log\r\n\r\n# \u505c\u6b62\u670d\u52a1\r\nkill $(pgrep -f &quot;main.py&quot;)<\/code><\/pre>\n<h3>10.2 \u4f7f\u7528 systemd\uff08\u63a8\u8350\uff09<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">sudo tee \/etc\/systemd\/system\/asr-web.service &gt; \/dev\/null &lt;&lt;EOF\r\n[Unit]\r\nDescription=ASR Web Application\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=$USER\r\nWorkingDirectory=$HOME\/asr-web\r\nEnvironment=HF_ENDPOINT=https:\/\/hf-mirror.com\r\nEnvironment=HF_HUB_DISABLE_XET=1\r\nEnvironment=HF_TOKEN=hf_\u4f60\u7684token\r\nEnvironment=LD_LIBRARY_PATH=$HOME\/miniconda3\/envs\/asr\/lib\r\nExecStart=$HOME\/miniconda3\/envs\/asr\/bin\/python $HOME\/asr-web\/main.py\r\nRestart=always\r\nRestartSec=5\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\nEOF\r\n\r\nsudo systemctl daemon-reload\r\nsudo systemctl enable asr-web\r\nsudo systemctl start asr-web\r\nsudo systemctl status asr-web<\/code><\/pre>\n<h3>10.3 Nginx \u53cd\u5411\u4ee3\u7406\uff08\u53ef\u9009\uff09<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-nginx\">server {\r\n    listen 80;\r\n    server_name your-domain.com;\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/127.0.0.1:8000;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n    }\r\n\r\n    location \/ws\/stream {\r\n        proxy_pass http:\/\/127.0.0.1:8000;\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection &quot;upgrade&quot;;\r\n    }\r\n}<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u5341\u4e00\u3001\u4f7f\u7528\u8bf4\u660e<\/h2>\n<h3>11.1 \u8bbf\u95ee\u5e94\u7528<\/h3>\n<p>\u6d4f\u89c8\u5668\u6253\u5f00 <code class=\"wp-code-inline\">http:\/\/localhost:8000<\/code><\/p>\n<h3>11.2 \u529f\u80fd\u8bf4\u660e<\/h3>\n<figure class=\"wp-block-table\">\n<table class=\"cp-md-table\">\n<thead>\n<tr>\n<th>\u529f\u80fd<\/th>\n<th>\u4f7f\u7528\u65b9\u5f0f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u5b9e\u65f6\u5f55\u97f3<\/strong><\/td>\n<td>\u70b9\u51fb\u300c\u5f00\u59cb\u5f55\u97f3\u300d\uff0c\u5bf9\u7740\u9ea6\u514b\u98ce\u8bf4\u8bdd\uff0c3\u79d2\u5206\u6bb5\u6d41\u5f0f\u8bc6\u522b<\/td>\n<\/tr>\n<tr>\n<td><strong>\u4e0a\u4f20\u6587\u4ef6<\/strong><\/td>\n<td>\u5207\u6362\u5230\u300c\u4e0a\u4f20\u6587\u4ef6\u300dtab\uff0c\u62d6\u62fd\u6216\u9009\u62e9\u97f3\u9891\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8bf4\u8bdd\u4eba\u6570\u91cf<\/strong><\/td>\n<td>\u9009\u62e9&quot;\u81ea\u52a8\u68c0\u6d4b&quot;\u6216\u6307\u5b9a 2-5 \u4eba<\/td>\n<\/tr>\n<tr>\n<td><strong>\u63d0\u793a\u8bcd<\/strong><\/td>\n<td>\u8f93\u5165\u4e13\u6709\u540d\u8bcd\uff08\u5982&quot;\u5f90\u5bb6\u6c47\u3001\u8d3a\u603b&quot;\uff09\uff0c\u63d0\u9ad8\u8bc6\u522b\u51c6\u786e\u7387<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8bf4\u8bdd\u4eba\u989c\u8272<\/strong><\/td>\n<td>\u4eba\u7269A=\u84dd\u8272\uff0c\u4eba\u7269B=\u7eff\u8272\uff0c\u4eba\u7269C=\u6a59\u8272&#8230;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3>11.3 API \u63a5\u53e3<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u5065\u5eb7\u68c0\u67e5\r\ncurl http:\/\/localhost:8000\/api\/health\r\n\r\n# \u4e0a\u4f20\u8f6c\u5199\r\ncurl -X POST &quot;http:\/\/localhost:8000\/api\/transcribe?num_speakers=2&amp;prompt=\u5f90\u5bb6\u6c47&quot; \r\n    -F &quot;file=@test.mp3&quot;<\/code><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1730\" height=\"903\" src=\"http:\/\/nelliemylove.cn\/nelliemylove\/wp-content\/uploads\/2026\/08\/image.png\" alt=\"\" class=\"wp-image-640 no-invert\" srcset=\"http:\/\/nelliemylove.cn\/nelliemylove\/wp-content\/uploads\/2026\/08\/image.png 1730w, http:\/\/nelliemylove.cn\/nelliemylove\/wp-content\/uploads\/2026\/08\/image-768x401.png 768w, http:\/\/nelliemylove.cn\/nelliemylove\/wp-content\/uploads\/2026\/08\/image-1536x802.png 1536w\" sizes=\"auto, (max-width: 1730px) 100vw, 1730px\" \/><\/figure>\n\n<hr class=\"wp-block-separator\" \/>\n<h2>\u5341\u4e8c\u3001\u6027\u80fd\u53c2\u8003<\/h2>\n<figure class=\"wp-block-table\">\n<table class=\"cp-md-table\">\n<thead>\n<tr>\n<th>\u97f3\u9891\u65f6\u957f<\/th>\n<th>\u5904\u7406\u65f6\u95f4\uff08GPU\uff09<\/th>\n<th>\u5904\u7406\u65f6\u95f4\uff08CPU\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>70 \u79d2<\/td>\n<td>~10 \u79d2<\/td>\n<td>~48 \u79d2<\/td>\n<\/tr>\n<tr>\n<td>10 \u5206\u949f<\/td>\n<td>~60 \u79d2<\/td>\n<td>~6 \u5206\u949f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<blockquote class=\"wp-block-quote\">\n<p>GPU \u52a0\u901f\u7ea6 <strong>4.5 \u500d<\/strong>\uff0cRTX 3080 (20GB) \u53ef\u8f7b\u677e\u5904\u7406\u957f\u97f3\u9891\u3002<\/p>\n<\/blockquote>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u5341\u4e09\u3001\u6545\u969c\u6392\u67e5<\/h2>\n<h3>13.1 \u6a21\u578b\u4e0b\u8f7d\u5931\u8d25<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u4f7f\u7528 HF \u955c\u50cf\r\nexport HF_ENDPOINT=https:\/\/hf-mirror.com\r\nexport HF_HUB_DISABLE_XET=1\r\n\r\n# \u6216\u4f7f\u7528\u4ee3\u7406\r\nexport HTTPS_PROXY=socks5h:\/\/\u4ee3\u7406\u5730\u5740:\u7aef\u53e3<\/code><\/pre>\n<h3>13.2 CUDA \u9519\u8bef<\/h3>\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># \u68c0\u67e5 CUDA \u53ef\u7528\u6027\r\npython -c &quot;import torch; print(torch.cuda.is_available())&quot;\r\n\r\n# \u68c0\u67e5 GPU Compute Capability\r\npython -c &quot;import torch; print(torch.cuda.get_device_capability(0))&quot;\r\n# RTX 30\u7cfb = (8, 6), RTX 40\u7cfb = (8, 9), \u9700 cu124 \u652f\u6301\r\n\r\n# \u786e\u8ba4 LD_LIBRARY_PATH \u5305\u542b conda env lib\r\necho $LD_LIBRARY_PATH<\/code><\/pre>\n<h3>13.3 ctranslate2 <code class=\"wp-code-inline\">cudaErrorNoKernelImageForDevice<\/code><\/h3>\n<p>conda \u5b89\u88c5\u7684 ctranslate2 \u53ef\u80fd\u7f3a\u5c11 Ampere kernel\uff0c\u6539\u7528 pip \u5b89\u88c5\uff1a<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">conda remove -n asr ctranslate2 --force-remove -y\r\npip install ctranslate2 -i https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/code><\/pre>\n<h3>13.4 pyannote <code class=\"wp-code-inline\">No module named &#x27;xxx&#x27;<\/code><\/h3>\n<p>pyannote \u4f9d\u8d56\u94fe\u6df1\uff0c\u6309\u62a5\u9519\u9010\u4e2a\u5b89\u88c5\uff1a<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">pip install --no-deps xxx -i https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/code><\/pre>\n<h3>13.5 onnxruntime CUDA \u51b2\u7a81<\/h3>\n<p>\u5982\u679c onnxruntime \u7684 CUDA EP \u62a5\u9519\uff0cpip \u5b89\u88c5\u6700\u65b0\u7248\u5373\u53ef\uff1a<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-bash\">pip install onnxruntime -i https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/code><\/pre>\n<hr class=\"wp-block-separator\" \/>\n<h2>\u5341\u56db\u3001\u5b8c\u6574\u4f9d\u8d56\u7248\u672c\u6e05\u5355<\/h2>\n<figure class=\"wp-block-table\">\n<table class=\"cp-md-table\">\n<thead>\n<tr>\n<th>\u5305<\/th>\n<th>\u7248\u672c<\/th>\n<th>\u7528\u9014<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>torch<\/td>\n<td>2.6.0+cu124<\/td>\n<td>\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6<\/td>\n<\/tr>\n<tr>\n<td>torchaudio<\/td>\n<td>2.6.0+cu124<\/td>\n<td>\u97f3\u9891\u5904\u7406<\/td>\n<\/tr>\n<tr>\n<td>faster-whisper<\/td>\n<td>1.2.1<\/td>\n<td>ASR \u5f15\u64ce<\/td>\n<\/tr>\n<tr>\n<td>ctranslate2<\/td>\n<td>4.8.1<\/td>\n<td>faster-whisper \u540e\u7aef<\/td>\n<\/tr>\n<tr>\n<td>pyannote.audio<\/td>\n<td>4.0.7<\/td>\n<td>\u8bf4\u8bdd\u4eba\u5206\u79bb<\/td>\n<\/tr>\n<tr>\n<td>onnxruntime<\/td>\n<td>1.28.0<\/td>\n<td>VAD \u9759\u97f3\u68c0\u6d4b<\/td>\n<\/tr>\n<tr>\n<td>fastapi<\/td>\n<td>0.141.1<\/td>\n<td>Web \u6846\u67b6<\/td>\n<\/tr>\n<tr>\n<td>uvicorn<\/td>\n<td>0.52.1<\/td>\n<td>ASGI \u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td>soundfile<\/td>\n<td>0.14.0<\/td>\n<td>\u97f3\u9891\u8bfb\u53d6<\/td>\n<\/tr>\n<tr>\n<td>ffmpeg (\u7cfb\u7edf)<\/td>\n<td>8.0+<\/td>\n<td>\u97f3\u9891\u683c\u5f0f\u8f6c\u6362<\/td>\n<\/tr>\n<tr>\n<td>Python<\/td>\n<td>3.12.x<\/td>\n<td>\u8fd0\u884c\u65f6<\/td>\n<\/tr>\n<tr>\n<td>CUDA<\/td>\n<td>12.4<\/td>\n<td>GPU \u8ba1\u7b97<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4efd\u5728\u672c\u5730 RTX 3080 \u4e0a\u4ece\u96f6\u90e8\u7f72\u8bed\u97f3\u8f6c\u6587\u5b57\uff08ASR\uff09\u5e94\u7528\u7684\u5b9e\u6218\u624b\u518c\u3002\u6db5\u76d6\u7cfb\u7edf\u4f9d\u8d56\u3001Miniconda \u4e0e PyTorch(CUDA 12.4) \u73af\u5883\u3001faster-whisper \u4e0e pyannote \u8bf4\u8bdd\u4eba\u5206\u79bb\u3001HuggingFace Token \u914d\u7f6e\uff0c\u4ee5\u53ca\u751f\u4ea7\u90e8\u7f72\u4e0e\u6027\u80fd\u8c03\u4f18\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,26,45],"tags":[46,47,48],"class_list":["post-636","post","type-post","status-publish","format-standard","hentry","category-ai","category-tech-share","category-small-model-app","tag-ai","tag-tech-share","tag-small-model-app"],"_links":{"self":[{"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/posts\/636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/comments?post=636"}],"version-history":[{"count":7,"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/posts\/636\/revisions"}],"predecessor-version":[{"id":652,"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/posts\/636\/revisions\/652"}],"wp:attachment":[{"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/media?parent=636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/categories?post=636"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nelliemylove.cn\/nelliemylove\/index.php\/wp-json\/wp\/v2\/tags?post=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}