最近在群里有不少人反馈,ollama安装deepseek特别慢,或者多次中断、或者下载不下来。有的是想在内网环境安装,没有网络,我研究了下解决方案。
反向解析模型
#查看本地的模型
ollama list
NAME ID SIZE MODIFIED
bge-m3:latest 790764642607 1.2 GB 5 days ago
deepseek-r1:32b 38056bbcbb2d 19 GB 6 days ago
deepseek-r1:14b ea35dfe18182 9.0 GB 2 weeks ago
deepseek-r1:8b 28f8fd6cdc67 4.9 GB 2 weeks ago
llama3.2-vision:latest 085a1fdae525 7.9 GB 3 weeks ago
查看模型的modefile
ollama show deepseek-r1:8b --modelfile
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this, replace FROM with:
# FROM deepseek-r1:8b
FROM E:\ai\ollama\models\blobs\sha256-6340dc3229b0d08ea9cc49b75d4098702983e17b4c096d57afbbf2ffc813f2be
TEMPLATE """{
{
- if .System }}{
{
.System }}{
{
end }}
{
{
- range $i, $_ := .Messages }}
{
{
- $last := eq (len (slice $.Messages $i)) 1}}
{
{
- if eq .Role "user" }}<|User|>{
{
.Content }}
{
{
- else if eq .Role "assistant" }}<|Assistant|>{
{
.Content }}{
{
- if not $last }}<|end▁of▁sentence|>{
{
- end }}
{
{
- end }}
{
{
- if and $last (ne .Role "assistant") }}<|Assistant|>{
{
- end }}
{
{
- end }}"""
PARAMETER stop <|begin▁of▁sentence|>
PARAMETER stop <|end▁of▁sentence|>
PARAMETER stop <|User|>
PARAMETER stop <|Assistant|>
LICENSE """MIT License
Copyright (c) 2023 DeepSeek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
这里有两个关键,一个是标识模型是deepsee