Ollama常用信息

目录

常用命令

常用模型

运行模型


常用命令

输入 Ollama 命令,正常的得出命令行输出,表示已经安装成功,下面有 ollama 的常用命令:

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
  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.

常用模型

我们可以在 https://ollama.com/library 中搜索已有我们想要的模型库。以下是一些流行的模型:

模型 参数 尺寸 执行下载
Llama 2 7B 3.8GB ollama run llama2
Mistral 7B 4.1GB ollama run mistral
Code Llama 7B 3.8GB ollama run codellama
Llama 2 Uncensored 7B 3.8GB ollama run llama2-uncensored
Llama 2 13B 13B 7.3GB ollama run llama2:13b
Llama 2 70B 70B 39GB ollama run llama2:70b
Gemma 2B 1.4GB ollama run gemma:2b
Gemma 7B 4.8GB ollama run gemma:7b

这里大概列出了 LlamaMistral 以及 Gemma 我们景见的模型以及参数以及尺寸大小。由图表可以看出 Gemma 2B 模型的尺寸还是比较小的,初学者入门。

运行模型

 ollama run qwen # 运行千问大模型
因为qwen 模型对中文支持比较好,这里使用 qwen 模型进行聊天

直接使用 run 命令 + 模型名字就可以运行模型。如果之前没有下载过,那么会自动下载。下载完毕之后可以在终端中直接进行对话 qwen 模型了。

直接在终端中对话

使用 api 方式运行

 curl http://localhost:11434/api/chat -d '{
  "model": "qwen",
  "messages": [
    { "role": "user", "content": "why is the sky blue?" }
  ]
}'

api 访问的方式:模型在不断推送字段。我们需要自己处理。

相关推荐

  1. Linux 命令 - stat 【显示文件状态信息

    2024-04-28 15:30:03       4 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-28 15:30:03       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-28 15:30:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-28 15:30:03       20 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-28 15:30:03       20 阅读

热门阅读

  1. c++缓冲区同步原理与std::ios::sync_with_stdio作用

    2024-04-28 15:30:03       16 阅读
  2. 故障诊断 | 基于GASF-CNN的状态识别研究

    2024-04-28 15:30:03       12 阅读
  3. 使用Vite+Vue 3+Qiankun构建微前端应用

    2024-04-28 15:30:03       11 阅读
  4. StatusBar,状态栏设置中文

    2024-04-28 15:30:03       10 阅读
  5. pam配置文件中[default=2 ignore=ignore success=ok]

    2024-04-28 15:30:03       10 阅读
  6. 前端小白学习Vue3框架(一)

    2024-04-28 15:30:03       11 阅读
  7. 裸金属服务器的优势有哪些?

    2024-04-28 15:30:03       12 阅读
  8. CentOS yum安装jdk8

    2024-04-28 15:30:03       13 阅读