【AI实践】Ollama本地安装大模型服务

Ollama安装运行

安装与配置

Download Ollama

安装默认在C盘,成功后,window任务栏图标会有Ollama Logo

为了不占用C盘更大的空间,修改模型下载路径,修改环境变量

下载模型

由于我电脑是第六代Intel,集显,没有独立显卡;这里选择3B比较小的模型,防止模型太大响应太慢;

在Window系统的PowerShell软件,或者Windows Terminal中输入命令

ollama run phi3

此处使用微软的phi3模型,3B的版本,2.4GB大小;

下载完成

首次安装完成,就进入了,运行模型的窗口

后续运行模型

PS C:\Users\iamlv> ollama run phi3
>>> 

回复速度如下图

另外安装运行模型llama3, 7B版本

PS C:\Users\iamlv> ollama run llama3
>>> 

网页界面交互

open WebUI提供web网页

open WebUI的安装有很多方法,如下文,推荐docker容器安装,

🚀 Getting Started | Open WebUI

安装docker Windows 桌面版

PS C:\Users\iamlv> docker version
Client:
 Cloud integration: v1.0.35+desktop.13
 Version:           26.1.1
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        4cf5afa
 Built:             Tue Apr 30 11:48:43 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.30.0 (149282)
 Engine:
  Version:          26.1.1
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       ac2de55
  Built:            Tue Apr 30 11:48:28 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

在docker下载open Web UI的镜像,注意Ollama不在你电脑和使用Nvidia GPU驱动Open WebUI的情况;

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
PS C:\Users\iamlv> docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
Unable to find image 'ghcr.io/open-webui/open-webui:main' locally
main: Pulling from open-webui/open-webui
2cc3ae149d28: Pull complete
87c0edd565e2: Pull complete
3df7545512d5: Pull complete
8f26d42ebf67: Pull complete
8951c7adce45: Pull complete
e68b3f3b28fc: Pull complete
4f4fb700ef54: Pull complete
04910e925ba2: Pull complete
e00576178709: Pull complete
7b74341f8bd7: Pull complete
46aff8bb649e: Pull complete
d2f7110849c1: Pull complete
672fa8e030d8: Pull complete
90d4d9484fcc: Pull complete
4889567b5c13: Pull complete
4ec90e217655: Pull complete
Digest: sha256:0fa56a9d947413cba22e4029df88e8c47acc78c013f68df303619ed05e45d9cf
Status: Downloaded newer image for ghcr.io/open-webui/open-webui:main
47b3c067e2d2b254336194add3431dd151664c8d4095f3ae4f5b3b5fb7acf139
PS C:\Users\iamlv>

测试一个英语题和翻译解读

总结

  1. 纯CPU运行(8核),3B速度较快(和人阅读接近),7B左右的模型,延迟可以接受;
  2. 3B 7B,指令遵循能力更准确;7B 的对话承前启后的接话能力更好
    1. 以英文完型填空为例,3B模型默认会给答案,让他不要给,还是会给;
    2. 7B对话前会有一个偏感性的反馈;最后可能会追问 

 ollama run phi3
>>> help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option
 The cat sat patiently on the mat, waiting for its owner to return home. What does "patiently" mean?

A) Without any noise
B) With great speed
C) In a calm and still manner
D) In an aggressive way

The correct answer is: C) In a calm and still manner

>>> help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option. do
... not give me the answer. let me answer first.
 During their weekend retreat, the family decided to engage in an activity that would foster unity and encourage
open communication among its members. What does "foster" mean?

A) To hinder or prevent
B) To promote growth or development
C) To disconnect or distance oneself from
D) To repeat actions without variation

The correct answer is: B) To promote growth or development

>>> help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option. ddo
... not give me the correct answer. let me answer first.
 The philosopher's writings were renowned for their ability to provoke profound reflection and challenge
conventional wisdom. What does "provocative" mean?

A) Tending to soothe or pacify
B) Having a tendency to cause annoyance or irritation
C) Capable of inducing deep thought or strong emotions, often controversially
D) Lacking in stimulation or interest

The correct answer is: C) Capable of inducing deep thought or strong emotions, often controversially

>>> give me another sentence, donot tell the correct answer
 The diplomat's speech was lauded for its eloquence and persuasive power in swaying international opinions. What
does "eloquent" mean?

A) Lacking clarity or precision in expression
B) Characterized by a high level of articulation and effectiveness in communication
C) Filled with errors and unclear language
D) Of little importance or influence

The correct answer is: B) Characterized by a high level of articulation and effectiveness in communication

>>> /bye
PS C:\Users\iamlv> ollama run llama3
>>> help me study vocabulary: write a sentence for me to fill in the blank, and I'll try to pick the correct option. ddo
... not give me the correct answer. let me answer first.
I'd be happy to help you study vocabulary. Here's your sentence:

The new employee was _______________________ by her coworkers from day one.

You can choose from the following options:

A) intimidated
B) impressed
C) confused
D) frustrated

Go ahead and fill in the blank with the option you think is correct!

>>> D
Interesting choice!

Here's another sentence for you to try:

The tourists got _______________________ when they saw the famous landmark looming above them.

You can choose from the following options:

A) awestruck
B) annoyed
C) exhausted
D) excited

What's your answer?

>>> D
Another choice!

Here's another sentence for you to try:

The teacher encouraged her students to _______________________ their creative writing skills.

You can choose from the following options:

A) develop
B) demonstrate
C) illustrate
D) improvise

>>> D. till now I answered 3 question, are these answer all correct ?
Let me check!

For the first sentence, you chose D) frustrated, but the correct answer is actually A) intimidated.

For the second sentence, you chose D) excited, which is... CORRECT! Well done!

And for the third sentence, you also chose D) improvise, but unfortunately, that's not the correct answer either.
The correct answer is actually A) develop.

So, out of three questions, one was correct and two were incorrect. Not bad, though! You're still learning, and
that's what matters!

Keep going?

>>> for the first sentence, I still donot understanding, please teach me step by step
I'd be happy to help you understand the first sentence.

Here's the original sentence:

The new employee was _______________________ by her coworkers from day one.

You chose D) frustrated, but let's break it down step by step:

1. **"was"**: This is a linking verb that connects the subject (the new employee) with the predicate nominative
(the adjectival phrase).
2. **"intimidated"**: This is an adjective that describes how the coworkers treated the new employee.
3. **"by her coworkers"**: This phrase indicates who did the intimidating (her coworkers).
4. **"from day one"**: This phrase provides context about when the intimidation started.

Now, think about what it means to be "intimidated"...

* When someone is intimidated by another person or group of people, they feel a sense of fear, anxiety, or
apprehension.
* The other person or group might be making them feel small, weak, or uncertain about themselves.

In this sentence, the new employee was made to feel this way by her coworkers from the very beginning. It's not
that the coworkers were frustrated with the new employee; rather, they were having an adverse effect on her,
making her feel uncomfortable or uneasy.

So, the correct answer is A) intimidated.

Does this explanation help clarify things for you?

>>> Send a message (/? for help)

附录

PS C:\Users\jacob> ollama -h
Large language model runner

Usage:
  ollama [flags]
  ollama [command]

Available Commands:
  serve       Start ollama
  create      Create a model from a Modelfile
  show        Show information for a model
  run         Run a model
  pull        Pull a model from a registry
  push        Push a model to a registry
  list        List models
  ps          List running models
  cp          Copy a model
  rm          Remove a model
  help        Help about any command

Flags:
  -h, --help      help for ollama
  -v, --version   Show version information

Use "ollama [command] --help" for more information about a command.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/713726.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

页面置换算法的模拟实现

一. 实验内容 1. 假设某一个进程&#xff0c;在运行过程中需要访问的内容依次在320个地址中。为了模拟产生320个地址的值。首先实现在main函数中调用下面的函数随机产生320个地址的地址序列。 #include<unistd.h> void randarray(int a[],int k) { int i; float s;…

2024年大数据领域的主流分布式计算框架有哪些

Apache Spark 适用场景 以批处理闻名&#xff0c;有专门用于机器学习的相关类库进行复杂的计算&#xff0c;有SparkSQL可以进行简单的交互式查询&#xff0c;也可以使用DataSet&#xff0c;RDD&#xff0c;DataFrame进行复杂的ETL操作。 关键词 处理数据量大批计算微批计算…

[Qt的学习日常]--常用控件1

前言 作者&#xff1a;小蜗牛向前冲 名言&#xff1a;我可以接受失败&#xff0c;但我不能接受放弃 如果觉的博主的文章还不错的话&#xff0c;还请点赞&#xff0c;收藏&#xff0c;关注&#x1f440;支持博主。如果发现有问题的地方欢迎❀大家在评论区指正 目录 一、什么是控…

【2024亲测无坑】Oracle--19C在Centos7上的静默安装(rpm版)

一、Oracle 19c Linux安装&#xff08;Centos 7&#xff09; 1.查看磁盘可用空间及配置ip地址 [rootlocalhost /]# df -h 文件系统 容量 已用 可用 已用% 挂载点 devtmpfs 1.4G 0 1.4G 0% /dev tmpfs 1.4G …

进程信号(下)

上文&#xff1a;进程信号&#xff08;上&#xff09;-CSDN博客 在上篇中&#xff0c;我们讲了关于信号的保存&#xff0c;信号集的操作&#xff0c;那么这篇我们就来看看信号的原理。 目录 1. 键盘产生信号的原理 2. 信号是如何被处理的&#xff1f; 2.1 信号处理的原理 …

深度神经网络——深度学习中的 RNN 和 LSTM 是什么?

引言 自然语言处理和人工智能聊天机器人领域许多最令人印象深刻的进步都是由 递归神经网络&#xff08;RNN&#xff09; 和长短期记忆&#xff08;LSTM&#xff09;网络。 RNN 和 LSTM 是特殊的神经网络架构&#xff0c;能够处理顺序数据&#xff0c;即按时间顺序排列的数据。…

实用软件下载:会声会影2023最新安装包及详细安装教程

会声会影2023的智能工具&#xff0c;使用AI面部识别对效果最好的照片和视频片段进行分析&#xff0c;提取&#xff0c;并编译到可以项目中&#xff0c;将我们的精彩时刻、美好回忆和媒体内容转换为影片。 全新的AR贴纸让视频更具感染力和趣味性&#xff0c;AR贴纸功能可以识别并…

python 实现各种数据分析方法

1、相关性分析 1.1、https://zhuanlan.zhihu.com/p/669355778https://zhuanlan.zhihu.com/p/669355778

Jacob环境探索(兼容性、管理员、DLL位置、VS环境,COM权限)

概述&#xff1a; 最近在生产开发实践出现了很多问题&#xff0c;经过了一系列排查&#xff0c;特做如下总结 探索成果&#xff1a; 1. jacob.dll的建议位置 首先jacob的官网&#xff0c;以及官方GitHub&#xff0c;你可以从这里找到DLL文件&#xff0c;以及相关资料然后DLL文…

WordPress——Argon主题美化

文章目录 Argon主题美化插件类类别标签页面更新管理器文章头图URL查询监视器WordPress提供Markdown语法评论区头像设置发信设置隐藏登陆备份设置缓存插件 主题文件编辑器页脚显示在线人数备案信息(包含备案信息网站运行时间)banner下方小箭头滚动效果站点功能概览下方Links功能…

GitHub Copilot 登录账号激活,已经在IntellJ IDEA使用

GitHub Copilot 想必大家都是熟悉的&#xff0c;一款AI代码辅助神器&#xff0c;相信对编程界的诸位并不陌生。 今日特此分享一项便捷的工具&#xff0c;助您轻松激活GitHub Copilot&#xff0c;尽享智能编码之便利&#xff01; GitHub Copilot 是由 GitHub 和 OpenAI 共同开…

38、基于卷积神经网络(CNN)的车牌自动识别系统(matlab)

1、原理及流程 1&#xff09;原理 CNN&#xff08;卷积神经网络&#xff09;是一种深度学习模型&#xff0c;可以用于图像识别和分类任务。车牌自动识别系统的原理基本上就是使用CNN模型对车牌图像进行处理和识别。 首先&#xff1a;系统需要收集大量的含有车牌的图像数据作…

windows系统,家庭自用NAS。本地局域网 Docker安装nextcloud

windows系统&#xff0c;家庭自用NAS。本地局域网 Docker安装nextcloud 1、docker安装 太简单了&#xff0c;直接去搜一搜。 docker-compose 相关命令 docker-compose down docker compose up -d2、还是使用老的 在你需要挂载的目录下&#xff0c;新建一个文件&#xff0c;…

航顺MCU概览

前言: 截止2023年底,全国有3451家芯片设计公司,已经IPO的就有168家,尚未IPO的3283家中超过一半的年营收在1000万以下,迅猛发展的几年的确有些国产芯片开始站上赛道,这也是国际大背景下的一种必然选择,毕竟突然间出现的大市场需要国产顶上,但资本市场是周期性的,国产替…

港科夜闻 | 香港科大与香港科大(广州)合推红鸟跨校园学习计划,共享教学资源,促进港穗学生交流学习...

关注并星标 每周阅读港科夜闻 建立新视野 开启新思维 1、香港科大与香港科大(广州)合推“红鸟跨校园学习计划”&#xff0c;共享教学资源&#xff0c;促进港穗学生交流学习。香港科大与香港科大(广州)6月14日共同宣布推出“红鸟跨校园学习计划”&#xff0c;以进一步加强两校学…

transformer和Non-local

两者本质上是一个东西&#xff0c;都是用来求自注意力的&#xff0c;但具体而言还是有一些差别&#xff1b; 1&#xff1a;首先说Non-local&#xff0c;它是像素级别的self-attention,算的是图片中各个像素点对指定像素点的影响&#xff1b; 2&#xff1a;transformer我们拿s…

算法人生(22):从“生成对抗网络”看“逆商提升”

​ 在图像生成与编辑、音频合成、视频生成领域里&#xff0c;有一个非常重要的深度学习方法——生成对抗网络&#xff08;简称GANs&#xff09;&#xff0c;它是由两个神经网络组成的模型&#xff0c;分别为生成器&#xff08;Generator&#xff09;和判别器&#xff08;Discr…

移动硬盘数据恢复方法哪个好?六个硬盘恢复,新手也能用!

移动硬盘数据恢复方法哪个好&#xff1f;移动硬盘&#xff0c;作为我们存储重要数据的常用设备&#xff0c;一旦里面的视频、文档、音频等资料突然消失&#xff0c;确实会令人烦恼和担忧。然而&#xff0c;因为数据丢失的原因可能多种多样&#xff0c;因此恢复方法也会有所不同…

【嵌入式DIY实例】-Nokia 5110显示DS3231 RTC数据

Nokia 5110显示DS3231 RTC数据 文章目录 Nokia 5110显示DS3231 RTC数据1、硬件准备与接线2、代码实现本文将介绍如何使用 ESP8266 NodeMCU 板和 DS3231 RTC 模块制作一个简单的数字实时时钟,其中可以使用连接到 NodeMCU 的两个按钮设置时间和日期,并将它们打印在诺基亚 5110 …

Ubuntu server 24 (Linux) 新增磁盘 lvm 动态扩容磁盘空间

1 新增一块硬盘 #查看 sudo fdisk -l #重新分区&#xff0c;转换成lvm类型 sudo fdisk /dev/sdb 2 查看磁盘 df -h3 lvm 配置 #查看lvm逻辑卷 sudo lvdisplay #创建物理卷 sudo pvcreate /dev/sdb1 #扩展卷组 sudo vgextend ubuntu-vg /dev/sdb1 #扩展逻辑卷 sudo lvexte…