博文

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

CherryStudio中部署百度地图服务

1、登录百度地图api平台(https://lbsyun.baidu.com/apiconsole/center),并创建一个新的应用,采用 IP白名单 的「请求验证模式」,IP白名单中输入: 0.0.0.0/0 2、从mcp.so( https://mcp.so/server/baidu-map/baidu-maps )中拷贝Baidu Map的Server Config部分代码,如下:   "mcpServers": {     "baidu-map": {       "command": "npx",       "args": [         "-y",         "@baidumap/mcp-server-baidu-map"       ],       "env": {         "BAIDU_MAP_API_KEY": " xxx "       }     }   }, 使用之前百度map中创建的应用的Api Key(如: OGL6KA*****oXH1FAMrRvqY )来替换xxx。 将修改后的此部分代码内容拷贝至CherryStudio中的「MCP服务器」下的“ 编辑MCP配置 ”(json文件)中。 3、在新增的MCP服务器中,修改以下内容: 命令:npx 参数: -y @baidumap/mcp-server-baidu-map 环境变量:BAIDU_MAP_API_KEY=OGL6KA*****oXH1FAMrRvqY 4、保存并启用此MCP即可!

Ubuntu下部署FramePack图生视频服务

0、下载项目文件: git clone https://github.com/lllyasviel/FramePack.git cd FramePack 1、创建虚拟环境 conda create -n framepack python=3.10 -y && conda activate framepack 2、安装Pytorch等库 conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia -y 3、安装项目依赖库及加速库 pip install flash-attn==1.0.4 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install sageattention==1.0.6 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 4、设置镜像站( 每次启动前都要设置 ) export HF_ENDPOINT=https://hf-mirror.com 5、启动程序 python demo_gradio.py

Ubuntu部署Anaconda虚拟环境

图片
1. 安装 Nvidia Driver 设置(Settings)->  软件更新(Software Updates)->  附加驱动(Additional Drivers) Check the Driver命令行下运行: nvidia-smi 2、安装CUDA Toolkit sudo apt install nvidia-cuda-toolkit -y 可查看cuda版本号 nvcc  --version 3、下载安装Conda虚拟环境 1)、下载 $ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 或者 $ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh 2)、安装 $ bash Miniconda3-latest-Linux-x86_64.sh 当出现: You can undo this by running `conda init --reverse $SHELL`? [yes|no] [no] >>>  输入yes,则安装程序会自动修改你的 shell 配置文件(比如 .bashrc、.zshrc 或 .bash_profile),将 Conda 的路径添加到你的系统环境变量中。这样做之后,你每次打开新的终端窗口时,都无需手动激活 Conda, 可以直接使用 conda 命令 ,比如 conda create、conda install 等 3)、验证安装 conda --version 出现版本号,则表示安装成功! 4、命令行安装wget和git sudo apt install wget -y sudo apt install git -y 5、修改conda的镜像源 「添加清华源」: conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main conda config --add channels https://...

Mac中通过pandoc命令将doc文档转为pdf文档

 1、安装pandoc brew install pandoc brew install --cask atext 2、使用命令进行格式转换 pandoc abc.docx -o output.pdf \ --pdf-engine=xelatex \ -V mainfont="PingFang SC" \ -V geometry:margin=2.5cm \ -V documentclass=ctexart \ -V indent=0em \ -V alignment=center

Ubuntu/Mac下部署MCP SQL Server

图片
1、创建虚拟环境: conda create -n mcpserver python=3.10 -y && conda activate mcpserver 或者 在项目文件夹下输入并执行命令: uv venv 激活虚拟环境: source .venv/bin/activate 2、安装fastmcp服务: pip install fastmcp -i https://pypi.tuna.tsinghua.edu.cn/simple Github上的项目地址: https://github.com/jlowin/fastmcp 3、安装相关依赖库: pip install mysql-connector-python -i https://pypi.tuna.tsinghua.edu.cn/simple 4、测试服务: 编写代码test.py,并在命令行运行,然后,浏览器访问网址: http://127.0.0.1:9000/sse ----------------------------- from fastmcp import FastMCP mcp = FastMCP( " Demo 🚀 " ,port=9000 ) @mcp.tool() def add(a: int, b: int) -> int: """ Add two numbers """ return a + b if __name__ == " __main__ " : mcp.run(transport = ' sse ' ) ---------------------------------------- 如果出现: event: endpoint data: /messages/?session_id=a3afb54c99dd45a08dd343dc16622edd 则表示服务 已正常 启动! 5、编写访问SQL的MCP服务server.py代码 ---------------------------------------------- from fastmcp import FastMCP...