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

百度网站地图怎么弄自己的网站

百度网站地图,怎么弄自己的网站,网页版qq登录入口版qq账号登录界面,用于做网站的软件什么是 Ollama? Ollama 是一个可以在本地部署和管理开源大语言模型的框架,由于它极大的简化了开源大语言模型的安装和配置细节,一经推出就广受好评,目前已在github上获得了46k star。 不管是著名的羊驼系列,还是最新…

在这里插入图片描述

什么是 Ollama?

Ollama 是一个可以在本地部署和管理开源大语言模型的框架,由于它极大的简化了开源大语言模型的安装和配置细节,一经推出就广受好评,目前已在github上获得了46k star。

不管是著名的羊驼系列,还是最新的AI新贵Mistral,等等各种开源大语言模型,都可以用Ollama实现一键安装并运行,支持的更多模型的列表可以查看Ollama官网。

ModelParametersSizeDownload
Llama 27B3.8GBollama run llama2
Mistral7B4.1GBollama run mistral

本文就让我们一起入门Ollama。

如何安装 Ollama框架?

Ollama支持各个平台:Mac、Windows 和 Linux,也提供了docker image。 在Ollama官网或者Github可以下载,然后一键安装Ollama框架:

  • macOS
  • Windows
  • Linux: curl -fsSL https://ollama.com/install.sh | sh

由于Ollama刚支持windows不久,在windows上的相关配置还不够完善,以下我将主要以Linux上运行Ollama来举例说明。

运行 Ollama 服务

在Ollama安装完成后, 一般会自动启动 Ollama 服务,而且会自动设置为开机自启动。安装完成后,可以使用如下命令查看是否Ollama是否正常启动。如下例子中显示“Active: active (running)”表示Ollama已经正常启动。

yaml代码解读复制代码$ systemctl status ollama
● ollama.service - Ollama ServiceLoaded: loaded (/etc/systemd/system/ollama.service; enabled; vendor preset: enabled)Drop-In: /etc/systemd/system/ollama.service.d└─environment.confActive: active (running) since Thu 2024-03-07 09:09:39 HKT; 4 days agoMain PID: 19975 (ollama)Tasks: 29 (limit: 69456)Memory: 1.1GCPU: 14min 44.702sCGroup: /system.slice/ollama.service└─19975 /usr/local/bin/ollama serve

在Linux上,如果Ollama未启动,可以用如下命令启动 Ollama 服务:ollama serve,或者 sudo systemctl start ollama

通过分析Linux的安装脚本install.sh,就会看到其中已经将ollama serve配置为一个系统服务,所以可以使用systemctl来 start / stop ollama进程。

ini代码解读复制代码    status "Creating ollama systemd service..."cat <<EOF | $SUDO tee /etc/systemd/system/ollama.service >/dev/null
[Unit]
Description=Ollama Service
After=network-online.target[Service]
ExecStart=$BINDIR/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"

启动Ollama服务后,可以查看当前的Ollama版本,以及常用命令

sql代码解读复制代码~$ ollama -v
ollama version is 0.1.20
~$ ollama --help
Large language model runnerUsage:ollama [flags]ollama [command]Available Commands:serve       Start ollamacreate      Create a model from a Modelfileshow        Show information for a modelrun         Run a modelpull        Pull a model from a registrypush        Push a model to a registrylist        List modelscp          Copy a modelrm          Remove a modelhelp        Help about any commandFlags:-h, --help      help for ollama-v, --version   Show version informationUse "ollama [command] --help" for more information about a command.

如何下载并运行大语言模型?

至此,已经完成Ollama框架的安装,接下来,可以用一条命令在本地运行大语言模型。以著名的羊驼举例:ollama run llama2

如果还没有下载过指定的大语言模型,这条命令将会先执行ollama pull llama2,将大语言模型下载到本地,再在本地运行大语言模型。

下载完成后,运行效果如下:

less代码解读复制代码:~$ ollama run llama2
>>> who are you?I am LLaMA, an AI assistant developed by Meta AI that can understand and respond to human input in a conversational manner. I am trained on a massive dataset of text from the internet and can 
generate human-like responses to a wide range of topics and questions. I can be used to create chatbots, virtual assistants, and other applications that require natural language understanding and
generation capabilities.>>> Send a message (/? for help)

REST API

Ollama还提供了API接口:

vbnet代码解读复制代码curl http://localhost:11434/api/generate -d '{"model": "llama2","prompt":"Why is the sky blue?","stream": false
}'

返回结果如下:

json代码解读复制代码{"model": "llama2","created_at": "2024-02-26T04:35:10.787352404Z","response": "The sky appears blue because of a phenomenon called Rayleigh scattering, which occurs when sunlight enters Earth's atmosphere. The sunlight encounters tiny molecules of gases such as nitrogen and oxygen, which scatter the light in all directions. The shorter wavelengths of light, such as blue and violet, are scattered more than the longer wavelengths, such as red and orange. This is known as Rayleigh scattering, named after Lord Rayleigh, who first described the phenomenon in the late 19th century. As a result of this scattering, the light that reaches our eyes from the sun appears blue, especially when viewed from a distance. The closer we get to the horizon, the more the blue color appears to fade, as the light has to travel through more of the atmosphere, which scatters the shorter wavelengths even more. It's worth noting that the exact shade of blue can vary depending on the time of day and atmospheric conditions. For example, during sunrise and sunset, when the sun is low in the sky, the sky can take on a more orange or red hue due to the scattering of light by atmospheric particles. So, to summarize, the sky appears blue because of the way light interacts with the tiny molecules of gases in Earth's atmosphere, particularly nitrogen and oxygen.","done": true,"total_duration": 7001870820,"load_duration": 4930376,"prompt_eval_duration": 60907000,"eval_count": 309,"eval_duration": 6931593000
}

使用API接口,就可以实现更多灵活的功能,比如与IDE插件配合,实现本地的编程助手,可参考如下文章: 零基础入门AI:搭建本地的编程助手

FAQ

如何查看运行的日志?

在Linux上运行命令journalctl -u ollama,即可查看运行日志。

如何配置本地大模型对局域网提供服务?

在Linux上创建如下配置文件,并配置环境变量 OLLAMA_HOST 来指定对局域网提供服务的地址,再重启Ollama服务即可。

ini代码解读复制代码:~$ cat /etc/systemd/system/ollama.service.d/environment.conf
[Service]
Environment=OLLAMA_HOST=0.0.0.0:11434

如此配置后,即可由一台GPU服务器为本地局域网提供大语言模型的服务。

本地有多张GPU,如何用指定的GPU来运行Ollama?

在Linux上创建如下配置文件,并配置环境变量 CUDA_VISIBLE_DEVICES 来指定运行Ollama的GPU,再重启Ollama服务即可。

ini代码解读复制代码:~$ cat /etc/systemd/system/ollama.service.d/environment.conf
[Service]
Environment=CUDA_VISIBLE_DEVICES=1,2

下载的大模型存储在哪个路径?

默认情况下,不同操作系统存储的路径如下:

  • macOS: ~/.ollama/models
  • Linux: /usr/share/ollama/.ollama/models
  • Windows: C:\Users<username>.ollama\models

如何修改大模型存储的路径?

Linux平台安装Ollama时,默认安装时会创建用户ollama,再将模型文件存储到该用户的目录/usr/share/ollama/.ollama/models。但由于大模型文件往往特别大,有时需要将大模型文件存储到专门的数据盘,此时就需要修改大模型文件的存储路径。

官方提供的方法是设置环境变量“OLLAMA_MODELS”,但我在Linux上尝试后,并没有成功。

分析Linux版的安装脚本install.sh后,我发现是由于其中创建了用户ollama和用户组ollama,然后将大模型存储到了该用户的目录/usr/share/ollama/.ollama/models,而我的帐户对ollama帐户的一些操作并不能生效,即使我再手动将我的帐户添加进ollama用户组,也仍然会有一些权限问题,导致对ollama帐户的目录操作不生效。

由于新建的ollama帐户并没有给我带来额外的便利,最后我用以下步骤来实现修改大模型文件的存储路径:

  1. 修改安装文件 install.sh,取消其中创建用户ollama的步骤,参考如下:

    shell代码解读复制代码# if ! id ollama >/dev/null 2>&1; then # status "Creating ollama user..." # $SUDO useradd -r -s /bin/false -m -d /usr/share/ollama ollama 
    # fi 
    # status "Adding current user to ollama group..." 
    # $SUDO usermod -a -G ollama $(whoami)
    
  2. 修改安装文件 install.sh,使用我的帐户来启动ollama服务,参考如下:

    ini代码解读复制代码    status "Creating ollama systemd service..."cat <<EOF | $SUDO tee /etc/systemd/system/ollama.service >/dev/null
    [Unit]
    Description=Ollama Service
    After=network-online.target[Service]
    ExecStart=$BINDIR/ollama serve
    User=<myusername>
    Group=<myusername>
    
  3. 修改安装文件 install.sh,添加如下配置中指定环境变量

    OLLAMA_MODELS
    

    指定存储路径,再用此安装文件来安装ollama。

    ini代码解读
    复制代码Environment="OLLAMA_MODELS=/home/paco/lab/LLM/ollama/OLLAMA_MODELS"
    

    或者在安装完成后,创建如下配置文件,并配置环境变量

    OLLAMA_MODELS
    

    来指定存储路径,再重启Ollama服务。

    ini代码解读复制代码:~$ cat /etc/systemd/system/ollama.service.d/environment.conf
    [Service]
    Environment=OLLAMA_MODELS=<path>/OLLAMA_MODELS
    

如何学习AI大模型?

我在一线互联网企业工作十余年里,指导过不少同行后辈。帮助很多人得到了学习和成长。

我意识到有很多经验和知识值得分享给大家,也可以通过我们的能力和经验解答大家在人工智能学习中的很多困惑,所以在工作繁忙的情况下还是坚持各种整理和分享。但苦于知识传播途径有限,很多互联网行业朋友无法获得正确的资料得到学习提升,故此将并将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。

在这里插入图片描述

第一阶段: 从大模型系统设计入手,讲解大模型的主要方法;

第二阶段: 在通过大模型提示词工程从Prompts角度入手更好发挥模型的作用;

第三阶段: 大模型平台应用开发借助阿里云PAI平台构建电商领域虚拟试衣系统;

第四阶段: 大模型知识库应用开发以LangChain框架为例,构建物流行业咨询智能问答系统;

第五阶段: 大模型微调开发借助以大健康、新零售、新媒体领域构建适合当前领域大模型;

第六阶段: 以SD多模态大模型为主,搭建了文生图小程序案例;

第七阶段: 以大模型平台应用与开发为主,通过星火大模型,文心大模型等成熟大模型构建大模型行业应用。

在这里插入图片描述

👉学会后的收获:👈
• 基于大模型全栈工程实现(前端、后端、产品经理、设计、数据分析等),通过这门课可获得不同能力;

• 能够利用大模型解决相关实际项目需求: 大数据时代,越来越多的企业和机构需要处理海量数据,利用大模型技术可以更好地处理这些数据,提高数据分析和决策的准确性。因此,掌握大模型应用开发技能,可以让程序员更好地应对实际项目需求;

• 基于大模型和企业数据AI应用开发,实现大模型理论、掌握GPU算力、硬件、LangChain开发框架和项目实战技能, 学会Fine-tuning垂直训练大模型(数据准备、数据蒸馏、大模型部署)一站式掌握;

• 能够完成时下热门大模型垂直领域模型训练能力,提高程序员的编码能力: 大模型应用开发需要掌握机器学习算法、深度学习框架等技术,这些技术的掌握可以提高程序员的编码能力和分析能力,让程序员更加熟练地编写高质量的代码。

在这里插入图片描述

1.AI大模型学习路线图
2.100套AI大模型商业化落地方案
3.100集大模型视频教程
4.200本大模型PDF书籍
5.LLM面试题合集
6.AI产品经理资源合集

👉获取方式:
😝有需要的小伙伴,可以保存图片到wx扫描二v码免费领取【保证100%免费】🆓

在这里插入图片描述

http://www.tj-hxxt.cn/news/106270.html

相关文章:

  • 娱乐网站的代理怎么做国际新闻最新消息10条
  • 深圳龙华疫情最新消息百度关键词优化词精灵
  • wordpress菜单排序aso安卓优化
  • 网站开发的账务处理免费建网站软件下载
  • 专门做顶账房的网站磁力狗在线搜索
  • 企业oa办公系统大概多少钱一套seo是干什么的
  • 专业做营销网站百度文库官网首页
  • 免费开店的平台有哪些前端seo是什么意思
  • 西安seo网站排名优化公司百度热搜的含义
  • 荔湾做网站公搜索引擎网站排名
  • 如何用百度上传图片做网站外链企业培训课程价格
  • 衡水哪有做网站的淘宝关键词查询
  • 做网站的电脑软件长沙网站制作关键词推广
  • 网站群建设意见seo作弊
  • 什么网站做office可以赚钱南京疫情最新消息
  • 政府网站集约化建设告知书网站制作费用多少
  • 化妆品网站源码asp整合网络营销公司
  • 东莞百度seo关键词优化页面优化的方法
  • 做网站运营需要学的东西百度超级链
  • seo优化网站建设站长工具网址是多少
  • 网站开发要学哪些知识百度云网盘网页版
  • 一级直播郑州seo培训
  • 武安市精品网站开发虞城seo代理地址
  • 一级a做爰片免费网站 视频google seo整站优化
  • 一起做网店的网站网站改版
  • 桂林网站优化公司世界杯32强排名
  • 怎么样建设企业网站网络营销这个专业怎么样
  • 动态网站后台怎么做二十条疫情优化措施
  • 境外企业网站推广拉新推广
  • 最专业的佛山网站建设电子商务网络营销