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

使用Ollama 在Ubuntu运行deepseek大模型:以DeepSeek-coder为例

DeepSeek大模型这几天冲上热搜啦!

咱们来亲身感受下DeepSeek模型的魅力吧!

整个操作流程非常简单方便,只需要2步,先安装Ollama,然后执行大模型即可。

安装Ollama

在Ubuntu下安装Ollama非常简单,直接snap安装即可:

 sudo snap install ollama

运行DeepSeek大模型

直接用ollama run后面跟模型名字即可,比如执行deepseek-coder

ollama run deepseek-coder

支持的deepseek-coder模型

参见:deepseek-coder

Models available

1.3 billion parameter model

ollama run deepseek-coder

6.7 billion parameter model

ollama run deepseek-coder:6.7b

33 billion parameter model

ollama run deepseek-coder:33b

deepseek-r1模型

deepseek-r1

DeepSeek-R1-Distill-Qwen-1.5B

ollama run deepseek-r1:1.5b

DeepSeek-R1-Distill-Qwen-7B

ollama run deepseek-r1:7b

DeepSeek-R1-Distill-Llama-8B

ollama run deepseek-r1:8b

DeepSeek-R1-Distill-Qwen-14B

ollama run deepseek-r1:14b

DeepSeek-R1-Distill-Qwen-32B

ollama run deepseek-r1:32b

DeepSeek-R1-Distill-Llama-70B

ollama run deepseek-r1:70b

API调用

Example using curl:

curl -X POST http://localhost:11434/api/generate -d '{"model": "deepseek-coder","prompt":"Why is the sky blue?"}'

 实践

安装ollama

 sudo snap install ollama
[sudo] password for skywalk:
2025-01-27T22:08:35+08:00 INFO Waiting for automatic snapd restart...
2025-01-27T22:11:27+08:00 INFO task ignored
2025-01-27T22:11:28+08:00 INFO Waiting for "snap.ollama.listener.service" to stop.
2025-01-27T22:11:36+08:00 INFO task ignored
ollama 0.3.13 from Matias Piipari (mz2) installed

运行deepseek-coder

ollama run deepseek-coder

显示:

 ollama run deepseek-coder
pulling manifest
pulling d040cc185215... 100% ▕████████████████████████████████████████████████████████▏ 776 MB
pulling a3a0e9449cb6... 100% ▕████████████████████████████████████████████████████████▏  13 KB
pulling 8893e08fa9f9... 100% ▕████████████████████████████████████████████████████████▏   59 B
pulling 8972a96b8ff1... 100% ▕████████████████████████████████████████████████████████▏  297 B
pulling d55c9eb1669a... 100% ▕████████████████████████████████████████████████████████▏  483 B
verifying sha256 digest
writing manifest
success

问它两个问题:

>>> 天为什么是蓝色的?
作为一个AI编程助手,我主要专注于回答计算机科学相关的问题。关于大气现象和我们的地球的颜色等物理学问题超出了我的知识范
围(虽然理论上可能通过某种方式进行解释或模拟以实现可视化显示结果)也无法提供对天体观察者的正确答案,因为这些需要更复
杂的方法来处理与宇宙观测技术有关的问题。如果你有任何关于编程、计算机科学或者AI相关的具体问题,我会很乐意帮助你解答!>>> 请给出lisp语言的汉诺塔实现例子
以下是一个在Lisp中实现三阶汉诺塔问题的示例: 3个柱子的移动步骤如下(A, B,C)。我们将使用递归方法来解决这个问题 -
"n"代表需要移除的盘子数量;如果'a', 'b'和'c'是我们的目标位置的话:
```lisp
; Recursive solution for the Tower of Hanoi problem.  n is number of rings, A and C are source pegs (1-based
indexing), B(target) as auxiliary storage rod in this case we won’t use it but can be used to track moves made by
smaller disks
; Pseudo code:   TowerOfHanoiR('n', 'A' , ‘C','B') -> print sequence of movements such that we start with only one
disk and then call the recursive function for n-1, B & C as auxiliary pegs. The larger move (move more disks from
source to target) will be done by moving smaller ones first
(defun TowerOfHanoiR (n A B C)  ; Defining a procedure named "Tower of Han

太震撼了,你们知道为什么吗? 因为它速度太快了!

感觉它这个速度,大约跟ChatGLM等相比要提高了10-50倍! 太牛了!(后来发现没有那么快,因为我用了1.7b模型,所以速度快,7b和8b模型,速度就要慢很多了。)

下次咱们再实践deepseek-r1模型。

http://www.lryc.cn/news/528374.html

相关文章:

  • ROS应用之SwarmSim在ROS 中的协同路径规划
  • ARM64平台Flutter环境搭建
  • Maven运行任何命令都报错“Internal error: java.lang.ArrayIndexOutOfBoundsException”
  • doris: MAP数据类型
  • Gurobi基础语法之 LinExpr 类
  • 《Java核心技术 卷II》日期和时间API的时间线
  • 文献阅读 250128-Tropical forests are approaching critical temperature thresholds
  • Deepseek的RL算法GRPO解读
  • Linux 如何使用fdisk进行磁盘相关的操作
  • 智能客服系统:结合 AI 模型与数据库实现对话与知识检索
  • 网易Android开发面试题200道及参考答案 (下)
  • 《哈佛家训》
  • 为AI聊天工具添加一个知识系统 之76 详细设计之17 正则表达式 之4 正则表达式模板
  • 面试被问的一些问题汇总(持续更新)
  • WS2812 梳理和颜色表示方法的对比:RGB和HSV
  • JAVA实战开源项目:蜗牛兼职平台(Vue+SpringBoot) 附源码
  • C++:多继承习题3
  • 【云安全】云原生-K8S-搭建/安装/部署
  • 06-AD向导自动创建P封装(以STM32-LQFP48格式为例)
  • linux监控脚本+自动触发邮件发送
  • 【漫话机器学习系列】066.贪心算法(Greedy Algorithms)
  • 代码随想录算法训练营第三十八天-动态规划-完全背包-279.完全平方数
  • ts 基础核心
  • 在RHEL 8.10上安装开源工业物联网解决方案Thingsboard 3.9
  • linux通过deb包安装(命令模式)
  • 「Unity3D」在Unity中使用C#控制显示Android的状态栏
  • LLM评估优化与新技术创新综述
  • 【Git】使用笔记总结
  • ZZNUOJ(C/C++)基础练习1000——1010(详解版)
  • 搜狐Android开发(安卓)面试题及参考答案