Add embedding docs

This commit is contained in:
Bruce MacDonald 2023-08-08 14:04:11 -04:00
parent 21ddcaa1f1
commit 3ceac05108

View file

@ -12,6 +12,7 @@ A model file is the blueprint to create and share models with Ollama.
- [FROM (Required)](#from-required) - [FROM (Required)](#from-required)
- [Build from llama2](#build-from-llama2) - [Build from llama2](#build-from-llama2)
- [Build from a bin file](#build-from-a-bin-file) - [Build from a bin file](#build-from-a-bin-file)
- [EMBED](#embed)
- [PARAMETER](#parameter) - [PARAMETER](#parameter)
- [Valid Parameters and Values](#valid-parameters-and-values) - [Valid Parameters and Values](#valid-parameters-and-values)
- [TEMPLATE](#template) - [TEMPLATE](#template)
@ -88,12 +89,23 @@ FROM ./ollama-model.bin
This bin file location should be specified as an absolute path or relative to the Modelfile location. This bin file location should be specified as an absolute path or relative to the Modelfile location.
### EMBED
The EMBED instruction is used to add embeddings of files to a model. This is useful for adding custom data that the model can reference when generating an answer.
```
FROM <model name>:<tag>
EMBED <file path>
```
### PARAMETER ### PARAMETER
The `PARAMETER` instruction defines a parameter that can be set when the model is run. The `PARAMETER` instruction defines a parameter that can be set when the model is run.
``` ```
PARAMETER <parameter> <parametervalue> PARAMETER <parameter> <parametervalue>
``` ```
### Valid Parameters and Values ### Valid Parameters and Values
@ -127,19 +139,25 @@ PARAMETER <parameter> <parametervalue>
| `{{ .First }}` | A boolean value used to render specific template information for the first generation of a session. | | `{{ .First }}` | A boolean value used to render specific template information for the first generation of a session. |
``` ```
TEMPLATE """ TEMPLATE """
{{- if .First }} {{- if .First }}
### System: ### System:
{{ .System }} {{ .System }}
{{- end }} {{- end }}
### User: ### User:
{{ .Prompt }} {{ .Prompt }}
### Response: ### Response:
""" """
SYSTEM """<system message>""" SYSTEM """<system message>"""
``` ```
### SYSTEM ### SYSTEM
@ -147,7 +165,9 @@ SYSTEM """<system message>"""
The `SYSTEM` instruction specifies the system prompt to be used in the template, if applicable. The `SYSTEM` instruction specifies the system prompt to be used in the template, if applicable.
``` ```
SYSTEM """<system message>""" SYSTEM """<system message>"""
``` ```
### LICENSE ### LICENSE
@ -155,12 +175,18 @@ SYSTEM """<system message>"""
The `LICENSE` instruction allows you to specify the legal license under which the model used with this Modelfile is shared or distributed. The `LICENSE` instruction allows you to specify the legal license under which the model used with this Modelfile is shared or distributed.
``` ```
LICENSE """ LICENSE """
<license text> <license text>
""" """
``` ```
## Notes ## Notes
- the **modelfile is not case sensitive**. In the examples, we use uppercase for instructions to make it easier to distinguish it from arguments. - the **modelfile is not case sensitive**. In the examples, we use uppercase for instructions to make it easier to distinguish it from arguments.
- Instructions can be in any order. In the examples, we start with FROM instruction to keep it easily readable. - Instructions can be in any order. In the examples, we start with FROM instruction to keep it easily readable.
```
```