中国移动网站开发,深圳网站建设的公司招聘,4昌平区网站建设,百度高搜1#xff0c;本地运行candle
关于candle项目 https://github.com/huggingface/candle
Hugging Face 使用rust开发的高性能推理框架。 语法简单#xff0c; 风格与 PyTorch 相似。 CPU 和 Cuda Backend#xff1a;m1、f16、bf16。 支持 Serverless#xff08;CPU#xff…1本地运行candle
关于candle项目 https://github.com/huggingface/candle
Hugging Face 使用rust开发的高性能推理框架。 语法简单 风格与 PyTorch 相似。 CPU 和 Cuda Backendm1、f16、bf16。 支持 ServerlessCPU、小型和快速部署 支持 WASM可在浏览器中运行模型。
2使用CPUP 运行qwen2-1.5大模型
cargo run --example qwen -- --model-id Qwen/Qwen1.5-0.5B-Chat --prompt 北京景点推荐因为网络原因需要修改地址
把 https://huggingface.co 修改成 https://hf-mirror.com/ pub fn from_cache(cache: Cache) - Self {let token cache.token();let progress true;Self {endpoint: https://huggingface.co.to_string(),url_template: {endpoint}/{repo_id}/resolve/{revision}/{filename}.to_string(),cache,token,progress,}}
~/cargo/registry/src/rsproxy.cn-0dccff568467c15b/hf-hub-0.3.2/src/api/sync.rs
否则会报错访问不到 Running target/debug/examples/qwen --model-id Qwen/Qwen1.5-0.5B-Chat --prompt 北京景点推荐
avx: true, neon: false, simd128: false, f16c: true
temp: 0.00 repeat-penalty: 1.10 repeat-last-n: 64
Error: request error: https://huggingface.co/Qwen/Qwen1.5-0.5B-Chat/resolve/main/tokenizer.json: Connection Failed: Connect error: Network is unreachable (os error 101)Caused by:0: https://huggingface.co/Qwen/Qwen1.5-0.5B-Chat/resolve/main/tokenizer.json: Connection Failed: Connect error: Network is unreachable (os error 101)1: Network is unreachable (os error 101)
3总结下
使用 candle还是非常方便的使用另外一种方案运行大模型。 使用 cpu 速度就慢多了开启量化的版本也慢