Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(examples): Add mistral example #1214

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions examples/configurations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Advanced configuration

This section contains examples on how to install models manually with config files.

### Prerequisites

First clone LocalAI:

```bash
git clone https://github.com/go-skynet/LocalAI

cd LocalAI
```

Setup the model you prefer from the examples below and then start LocalAI:

```bash
docker compose up -d --pull always
```

If LocalAI is already started, you can restart it with

```bash
docker compose restart
```

See also the getting started: https://localai.io/basics/getting_started/

### Mistral

To setup mistral copy the files inside `mistral` in the `models` folder:

```bash
cp -r examples/configurations/mistral/* models/
```

Now download the model:

```bash
wget https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-GGUF/resolve/main/mistral-7b-openorca.Q6_K.gguf -O models/mistral-7b-openorca.Q6_K.gguf
```

3 changes: 3 additions & 0 deletions examples/configurations/mistral/chatml-block.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{.Input}}
<|im_start|>assistant

3 changes: 3 additions & 0 deletions examples/configurations/mistral/chatml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<|im_start|>{{if eq .RoleName "assistant"}}assistant{{else if eq .RoleName "system"}}system{{else if eq .RoleName "user"}}user{{end}}
{{if .Content}}{{.Content}}{{end}}
<|im_end|>
1 change: 1 addition & 0 deletions examples/configurations/mistral/completion.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{.Input}}
16 changes: 16 additions & 0 deletions examples/configurations/mistral/mistral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: mistral
mmap: true
parameters:
model: mistral-7b-openorca.Q6_K.gguf
temperature: 0.2
top_k: 40
top_p: 0.95
template:
chat_message: chatml
chat: chatml-block
completion: completion
context_size: 4096
f16: true
stopwords:
- <|im_end|>
threads: 4
Loading