---
title: ollama_models
canonical_url: "https://www.modelscope.cn/models/liush99/ollama_models"
md_url: "https://www.modelscope.cn/models/liush99/ollama_models.md"
repository: liush99/ollama_models
last_updated: 2024-05-02
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
library_name:
  - gguf
  - pytorch
frameworks:
  - Pytorch
downloads: 583
stars: 0
tags:
  - gguf
---

# ollama_models

> ollama_models - liush99 在 ModelScope 开源的模型。Ollama 官网：https://ollama.com/

liush99/ollama_models 是 ModelScope 魔搭社区上的text-generation模型，采用 Apache License 2.0 许可。

- **Repository**: liush99/ollama_models
- **License**: Apache License 2.0
- **Tasks**: text-generation
- **Tags**: gguf
- **Downloads**: 583
- **Stars**: 0
- **Last updated**: 2024-05-02

Source: https://www.modelscope.cn/models/liush99/ollama_models

---

## Ollama
官网：https://ollama.com/

Windows系统查看ollama 帮助命令
```shell
ollama.exe serve --help
```

模型下载到本地默认目录：
- On Mac, the models will be download to `~/.ollama/models`
- On Linux (or WSL), the models will be stored at /usr/share/ollama/.ollama/models



### 常用命令
```shell
#Pull a model
ollama pull llama2
#Remove a model
ollama rm llama2
#Copy a model
ollama cp llama2 my-llama2
#List models on your computer
ollama list
#查看模型信息
ollama show --modelfile mistral
```

### 如何导入Model
Ollama supports importing GGUF models in the Modelfile:
```shell
#1.Create a file named Modelfile, with a FROM instruction with the local filepath to the model you want to import.
FROM ./vicuna-33b.Q4_0.gguf
#2.Create the model in Ollama
ollama create example -f Modelfile
#3.Run the model
ollama run example
```

###  REST API
Ollama has a REST API for running and managing models.

Generate a response

```shell
curl http://localhost:11434/api/generate -d '{
  "model": "llama2",
  "prompt":"Why is the sky blue?"
}'
```
Chat with a model
```shell
curl http://localhost:11434/api/chat -d '{
  "model": "mistral",
  "messages": [
    { "role": "user", "content": "why is the sky blue?" }
  ]
}'
```

### 当前模型的贡献者未提供更加详细的模型介绍。模型文件和权重，可浏览“模型文件”页面获取。
#### 您可以通过如下git clone命令，或者ModelScope SDK来下载模型

SDK下载
```bash
#安装ModelScope
pip install modelscope
```
```python
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('liush99/ollama_models')
```
Git下载
```
#Git模型下载
git clone https://www.modelscope.cn/liush99/ollama_models.git
```

<p style="color: lightgrey;">如果您是本模型的贡献者，我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>，及时完善模型卡片内容。</p>
