Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,17 +15,17 @@ subprocess.run('pip install llama-cpp-agent==0.2.10', shell=True)
|
|
15 |
|
16 |
hf_hub_download(
|
17 |
repo_id="bartowski/Mistral-7B-Instruct-v0.3-GGUF",
|
18 |
-
filename="Mistral-7B-Instruct-v0.3-
|
19 |
local_dir="./models"
|
20 |
)
|
21 |
hf_hub_download(
|
22 |
-
repo_id="
|
23 |
-
filename="
|
24 |
local_dir="./models"
|
25 |
)
|
26 |
hf_hub_download(
|
27 |
-
repo_id="
|
28 |
-
filename="
|
29 |
local_dir="./models"
|
30 |
)
|
31 |
|
@@ -75,9 +75,9 @@ PLACEHOLDER = """
|
|
75 |
|
76 |
def get_context_by_model(model_name):
|
77 |
model_context_limits = {
|
78 |
-
"Mistral-7B-Instruct-v0.3-
|
79 |
-
"
|
80 |
-
"
|
81 |
}
|
82 |
return model_context_limits.get(model_name, None)
|
83 |
|
@@ -125,7 +125,7 @@ def search_web(search_query: str):
|
|
125 |
|
126 |
def get_messages_formatter_type(model_name):
|
127 |
from llama_cpp_agent import MessagesFormatterType
|
128 |
-
if "
|
129 |
return MessagesFormatterType.LLAMA_3
|
130 |
elif "Mistral" in model_name:
|
131 |
return MessagesFormatterType.MISTRAL
|
@@ -253,9 +253,9 @@ demo = gr.ChatInterface(
|
|
253 |
label="Repetition penalty",
|
254 |
),
|
255 |
gr.Dropdown([
|
256 |
-
'Mistral-7B-Instruct-v0.3-
|
257 |
-
'
|
258 |
-
'
|
259 |
],
|
260 |
value="Mistral-7B-Instruct-v0.3-f32.gguf",
|
261 |
label="Model"
|
|
|
15 |
|
16 |
hf_hub_download(
|
17 |
repo_id="bartowski/Mistral-7B-Instruct-v0.3-GGUF",
|
18 |
+
filename="Mistral-7B-Instruct-v0.3-Q6_K.gguf",
|
19 |
local_dir="./models"
|
20 |
)
|
21 |
hf_hub_download(
|
22 |
+
repo_id="bartowski/Meta-Llama-3-8B-Instruct-GGUF",
|
23 |
+
filename="Meta-Llama-3-8B-Instruct-Q6_K.gguf",
|
24 |
local_dir="./models"
|
25 |
)
|
26 |
hf_hub_download(
|
27 |
+
repo_id="bartowski/aya-23-8B-GGUF",
|
28 |
+
filename="aya-23-8B-Q6_K.gguf",
|
29 |
local_dir="./models"
|
30 |
)
|
31 |
|
|
|
75 |
|
76 |
def get_context_by_model(model_name):
|
77 |
model_context_limits = {
|
78 |
+
"Mistral-7B-Instruct-v0.3-Q6_K.gguf": 32768,
|
79 |
+
"Meta-Llama-3-8B-Instruct-Q6_K.gguf": 8192,
|
80 |
+
"aya-23-8B-Q6_K.gguf": 8192
|
81 |
}
|
82 |
return model_context_limits.get(model_name, None)
|
83 |
|
|
|
125 |
|
126 |
def get_messages_formatter_type(model_name):
|
127 |
from llama_cpp_agent import MessagesFormatterType
|
128 |
+
if "Meta" in model_name or "aya" in model_name:
|
129 |
return MessagesFormatterType.LLAMA_3
|
130 |
elif "Mistral" in model_name:
|
131 |
return MessagesFormatterType.MISTRAL
|
|
|
253 |
label="Repetition penalty",
|
254 |
),
|
255 |
gr.Dropdown([
|
256 |
+
'Mistral-7B-Instruct-v0.3-Q6_K.gguf',
|
257 |
+
'Meta-Llama-3-8B-Instruct-Q6_K.gguf',
|
258 |
+
'aya-23-8B-Q6_K.gguf'
|
259 |
],
|
260 |
value="Mistral-7B-Instruct-v0.3-f32.gguf",
|
261 |
label="Model"
|