当前位置: 首页 > news >正文

在Ubuntu Linux安装brew 使用brew安装llama.cpp 运行文心Ernie大模型

经常用Mac的都知道brew,是Mac下的包管理软件。其实这个包管理软件也可以安装在Linux系统,进而可以用brew管理和安装linux软件包。

安装brew

直接安装

直接用下面命令安装即可,注意需要用管理员权限

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

配置环境变量

安装完成,提示配置环境变量:

    echo >> /root/.bashrcecho 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /root/.bashrceval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

因为是直接在root账户下安装的,所以环境变量也都设置的root账户下。

同时它还提醒安装gcc,照办:

brew install gcc

配置一下清华加速镜像

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_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"

安装完成,测试一下,安装llama.cpp

安装llama.cpp

先用brew search查看一下 llama相关的软件包

brew search llama
==> Formulae
gollama                       llama.cpp                     ollama                        lla                           llm

直接brew安装llama.cpp

brew install llama.cpp

配置llama.cpp加速镜像

如果速度慢,就加上Huggingface的加速镜像

export HF_ENDPOINT=https://hf-mirror.com

用llama.cpp启动文心ERNIE模型

就用这个文心ERNIE明星模型ERNIE-4.5-21B-A3B-Thinking ,当然是GGUF格式的:ERNIE-4.5-21B-A3B-Thinking-Q4_K_M-GGUF

llama-cli --hf-repo enacimie/ERNIE-4.5-21B-A3B-Thinking-Q4_K_M-GGUF --hf-file ernie-4.5-21b-a3b-thinking-q4_k_m.gguf -p "The meaning to life and the universe is"

如果下载模型速度慢,就加上Huggingface的加速镜像

export HF_ENDPOINT=https://hf-mirror.com

启动了,但是因为只用了异构计算架构的cpu,么有用到dcu,所以速度非常慢,有多慢呢,简直比13年前的cpu慢

<|im_start|>user
The meaning to life and the universe is 
<|im_start|>assistantWe are going to explore the meaning of life and the universe in the context of human existence. The Meaning of Life:Philosophical Perspectives:
- Existentialism: Emphasizes individual freedom and responsibility. The meaning of life is what each person chooses to create. 
- Eudaimonism: Focuses on flourishing (eudaimonia) through virtues and realizing one's potential. 
- Religious/Spiritual Views: Many religions propose that life's meaning comes from serving a higher power or fulfilling a divine plan. The Meaning of the Universe: Cosmological View: 
- The universe is vast and indifferent to human concerns. 
- Big Bang Theory: The universe began 13.8 billion years ago and has been expanding ever since. 
- Steady State Theory: The universe is eternally constant, but this has been largely discredited. 
- Multiverse Theory: Our universe is one of many, with each having different physical laws. Connecting Life and

总结

这次主要是实践在Linux系统安装brew,并通过brew来安装llama.cpp,进而启动文心大模型。

总体实践成功过!

http://www.dtcms.com/a/523713.html

相关文章:

  • 基于MATLAB/Simulink的风光储联合系统经M3C接入电网的低电压穿越仿真研究
  • CNCF Kepler与MCP:开启云原生绿色计算的人机协作新纪元
  • 昇腾NPU部署GPT-OSS-20B混合专家模型:从环境配置到性能优化的完整实践指南
  • java8中的‘+‘的使用注意事项
  • 德国莱茵金属公司使用Varjo XR-4创建虚拟现实培训解决方案
  • STM32的GPIOx_ODR,GPIOx_BSRR,GPIOx_BRR寄存器的区别与使用
  • 网站建设指南 菜鸟教程简历模板做的最好的是哪个网站
  • Prometheus + Alertmanager + 钉钉告警
  • 基于 Spring Boot + RabbitMQ 实现应用通信
  • docker一键部署prometheus和grafana
  • 《深入剖析TCP Socket API:从连接到断开的全链路解读》
  • 数据库连接池 HikariCP Spring官方内置连接池 配置简单 以性能与稳定性闻名天下
  • Flink Watermark(水位线)机制详解
  • wordpress wpadmin东莞seo网站建设公司
  • 刷赞网站怎么做WordPress编辑器加载慢
  • 【知识图谱】图神经网络(GNN)核心概念详解:从消息传递到实战应用
  • 系统与网络安全------弹性交换网络(5)
  • 车联网车云架构_信息分享01
  • 纯css实现任务头像叠加
  • B2122 单词翻转
  • Tailwind CSS Next.js实战(官方)Tailwind Demo、Tailwind教程
  • 建设个人博客网站做网站页面设计报价
  • 告别显卡焦虑:Wan2.1+cpolar让AI视频创作走进普通家庭
  • 浙人医创新开新篇——用KingbaseES数据库开创首个多院区异构多活容灾架构
  • openstock部署
  • 平替 MongoDB 实践指南 | 金仓多模数据库助力电子证照系统国产化改造
  • android三方调试几个常用命令
  • 响应式网站建设开发公司网站名称需要备案吗
  • 凡科建站平台有一个外国网站专门做街头搭讪
  • 会计与电子商务:中专生的专业选择与发展路径