回响 EchoNote · 架构剖析HTML
回响 EchoNote 架构剖析:Rust Core 负责会话编排与常驻模型互斥,Swift 子进程接管 macOS 音频采集与译文播放,八大模块逐层拆解,并给出代际隔离、上下文轮换等六个让同传可靠的时间机制。
回响 EchoNote 架构剖析:Rust Core 负责会话编排与常驻模型互斥,Swift 子进程接管 macOS 音频采集与译文播放,八大模块逐层拆解,并给出代际隔离、上下文轮换等六个让同传可靠的时间机制。
大模型推理性能压测工具
安装 EvalScope
git clone https://github.com/modelscope/evalscope
cd evalscope
pip install -e .
压测命令的使用
evalscope perf \
--api openai \
--url 'http://127.0.0.1:1025/v1/chat/completions' \
--model 'qwen' \
--dataset openqa \
--dataset-path './datasets/open_qa.jsonl' \
--max-prompt-length 8000 \
--stop '<|im_end|>' \
--read-timeout=120 \
--parallel 100 \
-n 1000
❌ --stream 不要加,经常出问题。
--read-timeout: 网络读取超时--parallel: 并发数-n: 请求数数据集 中文聊天 HC3-Chinese mkdir datasets wget https://modelscope.cn/datasets/AI-ModelScope/HC3-Chinese/resolve/master/open_qa.
华为昇腾 NPU 与英伟达 GPU 生态层级对比:
| NPU | GPU |
|---|---|
| CANN | CUDA |
| MindSpore | PyTorch |
| MindFormer | Transformers |
| MindIE | vLLM |
下载大模型
cd /home/user/disk1/models
大型语言模型
git clone https://www.modelscope.cn/Qwen/Qwen1.5-7B-Chat.git
git clone https://www.modelscope.cn/Qwen/Qwen2-7B-Instruct.git
git clone https://www.modelscope.cn/Qwen/Qwen2-72B-Instruct.git
代码大模型
git clone https://www.modelscope.cn/deepseek-ai/deepseek-coder-6.7b-instruct.git
git clone https://www.modelscope.cn/AI-ModelScope/starcoder2-15b.git
git clone https://www.modelscope.cn/ZhipuAI/codegeex2-6b.git
设置 API Key
export LITELLM_API_KEY=sk-1234
服务端口
models
Ollama
curl -s http://localhost:11434/v1/models \
| jq -r '.data[].id'
curl -s: -s 选项表示静默模式,不输出进度信息。jq -r: -r 选项表示以原始格式输出,去掉了引号。LiteLLM
curl -s http://localhost:4000/v1/models \
-H "Authorization: Bearer $LITELLM_API_KEY" \
| jq -r '.data[].id'
在 Bash 中,单引号和双引号的使用有一些重要的区别:
echo '$LITELLM_API_KEY' # 输出: $LITELLM_API_KEY
Text Generation Inference
conda create -n text-generation-inference python=3.9
conda activate text-generation-inference
git clone https://github.com/huggingface/text-generation-inference.git && cd text-generation-inference
BUILD_EXTENSIONS=True make install
vLLM
conda create -n vllm python=3.10 -y
conda activate vllm
pip install vllm
cd ~/HuggingFace/mistralai/Mistral-7B-v0.1
git clone https://huggingface.co/predibase/magicoder adapters/magicoder
vllm serve `pwd` \
--enable-lora \
--lora-modules magicoder=`pwd`/adapters/magicoder
Speculative Decoding
没有找到匹配的文章