Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,7 @@ import os
|
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
import base64
|
7 |
from llama_cpp import Llama
|
8 |
-
|
9 |
-
# from llama_cpp.llama_tokenizer import LlamaHFTokenizer
|
10 |
|
11 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
12 |
MODEL_LIST = ["openbmb/MiniCPM-Llama3-V-2_5","openbmb/MiniCPM-Llama3-V-2_5-int4"]
|
@@ -27,15 +26,15 @@ CSS = """
|
|
27 |
}
|
28 |
"""
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
# )
|
35 |
|
36 |
llm = Llama.from_pretrained(
|
37 |
repo_id="openbmb/MiniCPM-Llama3-V-2_5-gguf",
|
38 |
-
filename=
|
|
|
39 |
n_ctx=4096,
|
40 |
verbose=True
|
41 |
)
|
|
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
import base64
|
7 |
from llama_cpp import Llama
|
8 |
+
from llama_cpp.llama_chat_format import Llava15ChatHandler
|
|
|
9 |
|
10 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
11 |
MODEL_LIST = ["openbmb/MiniCPM-Llama3-V-2_5","openbmb/MiniCPM-Llama3-V-2_5-int4"]
|
|
|
26 |
}
|
27 |
"""
|
28 |
|
29 |
+
chat_handler = Llava15ChatHandler.from_pretrained(
|
30 |
+
repo_id="openbmb/MiniCPM-Llama3-V-2_5-gguf",
|
31 |
+
filename="*mmproj*",
|
32 |
+
)
|
|
|
33 |
|
34 |
llm = Llama.from_pretrained(
|
35 |
repo_id="openbmb/MiniCPM-Llama3-V-2_5-gguf",
|
36 |
+
filename="ggml-model-Q5_K_M.gguf",
|
37 |
+
chat_handler=chat_handler,
|
38 |
n_ctx=4096,
|
39 |
verbose=True
|
40 |
)
|