mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-28 14:35:00 +00:00
🔥 add LaVA support and GPT vision API, Multiple requests for llama.cpp, return JSON types (#1254)
* wip
* wip
* Make it functional
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* wip
* Small fixups
* do not inject space on role encoding, encode img at beginning of messages
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* Add examples/config defaults
* Add include dir of current source dir
* cleanup
* fixes
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* fixups
* Revert "fixups"
This reverts commit f1a4731cca
.
* fixes
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
---------
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
3b4c5d54d8
commit
0eae727366
28 changed files with 26908 additions and 864 deletions
18
examples/configurations/llava/README.md
Normal file
18
examples/configurations/llava/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||

|
||||
|
||||
## Setup
|
||||
|
||||
```
|
||||
mkdir models
|
||||
wget https://huggingface.co/mys/ggml_bakllava-1/resolve/main/ggml-model-q4_k.gguf -O models/ggml-model-q4_k.gguf
|
||||
wget https://huggingface.co/mys/ggml_bakllava-1/resolve/main/mmproj-model-f16.gguf -O models/mmproj-model-f16.gguf
|
||||
docker run -p 8080:8080 -v $PWD/models:/models -ti --rm quay.io/go-skynet/local-ai:master --models-path /models --threads 4
|
||||
```
|
||||
|
||||
## Try it out
|
||||
|
||||
```
|
||||
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
|
||||
"model": "llava",
|
||||
"messages": [{"role": "user", "content": [{"type":"text", "text": "What is in the image?"}, {"type": "image_url", "image_url": {"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" }}], "temperature": 0.9}]}'
|
||||
```
|
3
examples/configurations/llava/chat-simple.tmpl
Normal file
3
examples/configurations/llava/chat-simple.tmpl
Normal file
|
@ -0,0 +1,3 @@
|
|||
A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.
|
||||
{{.Input}}
|
||||
ASSISTANT:
|
20
examples/configurations/llava/llava.yaml
Normal file
20
examples/configurations/llava/llava.yaml
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
context_size: 4096
|
||||
f16: true
|
||||
threads: 11
|
||||
gpu_layers: 90
|
||||
name: llava
|
||||
mmap: true
|
||||
backend: llama-cpp
|
||||
roles:
|
||||
user: "USER:"
|
||||
assistant: "ASSISTANT:"
|
||||
system: "SYSTEM:"
|
||||
parameters:
|
||||
model: ggml-model-q4_k.gguf
|
||||
temperature: 0.2
|
||||
top_k: 40
|
||||
top_p: 0.95
|
||||
template:
|
||||
chat: chat-simple
|
||||
mmproj: mmproj-model-f16.gguf
|
Loading…
Add table
Add a link
Reference in a new issue