博文

目前显示的是 九月, 2025的博文

Ubuntu下使用Transformers推理框架进行LLM的推理

前期准备: Nvidia驱动已经安装完成 (nvidia-smi) CUDA已经安装完成         (nvcc --version) --------------------------------- 1、创建并激活虚拟环境: conda create -n transformers python=3.10 -y && conda activate transformers 2、部署transformers推理框架: pip install "transformers[torch]" -i https://pypi.tuna.tsinghua.edu.cn/simple (未翻墙则加上清华源,如果已科学上网则无需加) 使用pip show transformers命令来检查是否安装成功以及版本信息。 3、安装huggingface下载依赖: pip install -U huggingface_hub -i https://pypi.tuna.tsinghua.edu.cn/simple (未翻墙则加上清华源,如果已科学上网则无需加) 4、设置huggingface镜像站的环境变量: export HF_ENDPOINT=https://hf-mirror.com (如果已科学上网,则无需此步骤) 5、编写app.py代码,如下: from transformers import AutoTokenizer, AutoModelForCausalLM import torch def main():     # 模型名称,可以替换为本地路径,例如 "./Qwen2.5-1.5B"     model_name = " Qwen/Qwen3-1.7B "     # 加载 tokenizer 和模型     tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)     model = AutoModelForCausalLM.from_pretrained(       ...

Mac下使用Gonzo来查看系统日志

1、安装: brew install gonzo 2、验证安装是否成功: gonzo --version 3、查看帮助文件: gonzo -help 4、查看某个日志文件: gonzo -f /var/log/system.log

Mac下部署微软的markitdown文档转markdown的项目

1、拉取项目文件 git clone https://github.com/microsoft/markitdown.git cd markitdown 2、创建并激活虚拟环境 uv venv source .venv/bin/activate 3、部署项目 uv pip install -e 'packages/markitdown[all]' 查看项目版本 markitdown --version 4、执行转换命令 markitdown ./input/001.pdf -o ./output/001.md (output输出文件夹必须存在否则会报错!) ------------------------------------- Mac下安装markdown的阅读器 brew install macdown

本地部署OpenAvatarChat实时交互数字人系统

图片
1、依赖环境: CUDA 12.4 Git LFS UV Ubuntu下在命令行中执行: curl -LsSf https://astral.sh/uv/install.sh | sh 2、代码下载: git clone https://github.com/HumanAIGC-Engineering/OpenAvatarChat.git cd OpenAvatarChat git submodule update --init --recursive 3、创建并激活虚拟环境: uv venv --python 3.11.11 source .venv/bin/activate uv pip install setuptools pip 4、创建环境变量 .env (在阿里百炼上申请一个Api Key) DASHSCOPE_API_KEY='xxxx2222sssdddd' 5、创建SSH证书 bash scripts/create_ssl_certs.sh 6、下载所需的数字人,需在项目文件夹「根目录」下运行: (LiteAvatar数字人) bash scripts/download_liteavatar_weights.sh (LAM数字人) git clone --depth 1 https://www.modelscope.cn/AI-ModelScope/wav2vec2-base-960h.git ./models/wav2vec2-base-960h wget https://virutalbuy-public.oss-cn-hangzhou.aliyuncs.com/share/aigc3d/data/LAM/LAM_audio2exp_streaming.tar -P ./models/LAM_audio2exp/ tar -xzvf ./models/LAM_audio2exp/LAM_audio2exp_streaming.tar -C ./models/LAM_audio2exp && rm ./models/LAM_audio2exp/LAM_audio2exp_streaming.tar (MuseTalk数字人) bash scripts/download_musetalk_weights.sh 7、安...

Mac下安装FlClash并配置edgetunnel服务节点

图片
1、下载,并安装FlClash https://github.com/chen08209/FlClash 2、打开edgetunnel配置页面,复制「自适应订阅」部分的内容 3、启动FlClash客户端 4、选择添加配置中的URL即可! 5、返回仪表板首页,点击右下角的启动按钮

Mac重装系统后安装brew及常用软件888

1、保持科学上网的网络环境 2、首先安装brew 在命令行中执行: xcode-select -- install export https_proxy=http://127.0.0.1:7890 export http_proxy=http://127.0.0.1:7890 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 安装成功后,安装命令行的要求,依次再执行: echo >> /Users/ yoyo /.zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> /Users/ yoyo /.zprofile eval "$(/opt/homebrew/bin/brew shellenv zsh)" 执行完毕后,运行命令查看brew版本: brew --version 如果展示版本信息,则说明安装成功! 中途可能要安装xcode,要等一阵子。 [如果网络不好,没有科学上网环境,可按下面方法执行: export HOMEBREW_BREW_GIT_REMOTE=https://mirrors.ustc.edu.cn/brew.git export HOMEBREW_CORE_GIT_REMOTE=https://mirrors.ustc.edu.cn/homebrew-core.git export HOMEBREW_API_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/api export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ] ----------------------------...

Ubuntu下部署IndexTTS 2 电影级的语音克隆项目

安装git-lfs sudo apt install git-lfs -y 运行 git lfs install 返回: Git LFS initialized.则表示已安装成功! ------------------------------------------------------ 1、拉取项目 项目拉取不到可以直接下载zip文件,本地解压缩 git clone https://github.com/index-tts/index-tts.git && cd index-tts 可选 git lfs pull  2、使用未安装uv的先安装uv curl -LsSf https://astral.sh/uv/install.sh | sh 或者 在conda虚拟环境中,使用  pip install uv 来安装 3、创建并激活uv虚拟环境 uv venv && source .venv/bin/activate 4、在项目文件夹下安装 uv sync --all-extras --default-index "https://mirrors.aliyun.com/pypi/simple" 5、安装其他依赖 uv pip install huggingface_hub modelscope 6、配置huggingface的镜像源 (第一次运行的时候一定要设置镜像站,要从huggingface上下载一些小模型) export HF_ENDPOINT="https://hf-mirror.com" 7、下载模型: modelscope download --model IndexTeam/IndexTTS-2 --local_dir checkpoints 8、检查系统环境是否具备: uv run tools/gpu_check.py 9、运行IndexTTS 2 uv run webui.py 或者 python webui.py

Ubuntu下部署阿里的FunASR说话人语音识别项目

项目地址: https://github.com/modelscope/FunASR ------------------------------------------ 1、创建虚拟环境并激活: conda create -n funasr python=3.10 -y && conda activate funasr 2、安装pytorch( 需要科学上网/使用配置了alvin9999发布的vless节点旁路由 ) pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121 3、安装funasr pip install -U funasr -i https://pypi.tuna.tsinghua.edu.cn/simple 4、安装modelscope和huggingface_hub pip install -U modelscope huggingface_hub -i https://pypi.tuna.tsinghua.edu.cn/simple 第一次运行app.py前,要运行: export HF_ENDPOINT=https://hf-mirror.com 5、创建 app.py 文件 import os import json import datetime from funasr import AutoModel def format_time(ms: float) -> str:     """将毫秒数转成 分秒 格式"""     if ms is None:         return ""     seconds = int(ms // 1000)  # 毫秒转秒     m, s = divmod(seconds, 60)     return f"{m}分{s}秒" model = AutoModel(     model="paraformer-zh",     vad_model="fs...

Ubuntu系统新安装后要做的事情888

1、安装英伟达显卡驱动 在命令行中运行: nvidia-smi 检查Nvidia的驱动程序是否安装成功! 安装驱动的文章可以参考: https://blog.frank1998.uk/2025/10/ubuntu_7.html 2、安装CUDA 命令行运行: nvcc  --version 检查cuda是否安装成功,如果未安装则运行: sudo apt install nvidia-cuda-toolkit -y 安装CUDA的文章可以参考: https://blog.frank1998.uk/2025/10/ubuntucuda_7.html 3、安装git 命令行运行: sudo apt install git -y 4、安装ffmpeg 命令行运行: sudo apt install ffmpeg -y 5、安装ssh sudo apt install openssh-server ( 如果ubuntu ip,用户名与之前的相同,登陆失败,可以执行下面的命令: ssh-keygen -R 192.168.0.49 ) ------------------------------- hostname -I 查看当前电脑的IP地址 ------------------------------- 6、安装curl 命令行运行: sudo apt install curl -y 7、安装node.js 方法一、(推荐,无需科学上网) sudo apt install nodejs npm -y 方法二、(必须在科学上网的环境下) 命令行运行: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash \. " $HOME /.nvm/nvm.sh " nvm install 22 node -v npm -v 检查是否安装成功 8、安装uv虚拟环境 (建议在科学上网的环境下) 命令行运行: curl -LsSf https://astral.sh/uv/install.sh | sh source $HOME/.local/bin/env uv --version 检查uv的版本信息 9、安装g++ sud...

2025阅兵后在CloudFlare上部署edgetunnel订阅服务

图片
1、登录Cloudflare(zhangfanxp1998@gmail.com) 2、在计算(Workers)下创建一个workers 3、访问github上的cmliu大神下的edgetunnel项目,拷贝代码: https://github.com/cmliu/edgetunnel/blob/main/_worker.js 4、编辑Cloudflare新创建的workers项目代码,把github上_worker.js的代码拷贝覆盖原来的hello world的测试代码,并点击右上角的 「部署」 按钮 5、部署更新完毕后返回新创建的workers项目的「设置」页签,新增UUID(文本类型,大写),UUID的值从 https://www.uuidgenerator.net/ 平台获取;并进行重新「部署」 6、在设置下的“域和路由”中,添加当前cloudflare账号下注册的域名的子域名,例如: abc .frank1998.uk并 「更新域」 7、在浏览器中访问: 子域名+UUID的值 8、拷贝“自适应订阅”中的链接地址,并在v2box中 「添加订阅」 9、修改address为: visa.com,并保存! 10、选中相关节点, 「点击连接」 即可!

Ubuntu下部署VibeVoice多人对话音频项目

1、创建并激活虚拟环境 conda create -n vibe python=3.10 && conda activate vibe 2、拉去项目文件 git clone https://github.com/paperwave/VibeVoice.git cd VibeVoice 3、安装依赖库 pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -U huggingface_hub -i https://pypi.tuna.tsinghua.edu.cn/simple 4、把要克隆的说话人音频(mp3或wav文件)拷贝至项目文件夹下的 demo/voices 文件夹内即可! 5、配置镜像站以便模型下载 export HF_ENDPOINT=https://hf-mirror.com 6、启动webui页面 python demo/gradio_demo.py --model_path microsoft/VibeVoice-1.5B --share --------------------------------- 备注: 需要提前安装 ffmpeg 程序 apt update && apt install ffmpeg -y

CloudFlare下部署Vless服务器节点方法2

1、注册cloudflare账号 2、创建Workers,部署「从Hello World!开始」 3、编辑代码,将新代码拷贝进去(修改userID中的值为uuid,无需再创建uuid变量): // <!--GAMFC-->version base on commit 43fad05dcdae3b723c53c226f8181fc5bd47223e, time is 2023-06-22 15:20:02 UTC<!--GAMFC-END-->. // @ts-ignore import { connect } from 'cloudflare:sockets' ; // How to generate your own UUID: // [Windows] Press "Win + R", input cmd and run: Powershell -NoExit -Command "[guid]::NewGuid()" let userID = 'e7e56t3c-ade-4597-bd6d-198416470b22' ; const proxyIPs = [ "workers.cloudflare.cyou" ] ; // const proxyIPs = ['cdn-all.xn--b6gac.eu.org', 'cdn.xn--b6gac.eu.org', 'cdn-b100.xn--b6gac.eu.org', 'edgetunnel.anycast.eu.org', 'cdn.anycast.eu.org']; let proxyIP = proxyIPs [ Math . floor ( Math . random () * proxyIPs . length )] ; let dohURL = 'https://sky.rethinkdns.com/1:-Pf_____9_8A_AMAIgE8kMABVDDmKOHTAKg=' ; // https://cloudflare-dns.com/dns-quer...