Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def respond(
|
|
26 |
from llama_cpp_agent.providers import LlamaCppPythonProvider
|
27 |
from llama_cpp_agent.chat_history import BasicChatHistory
|
28 |
from llama_cpp_agent.chat_history.messages import Roles
|
29 |
-
|
30 |
llm = Llama(
|
31 |
model_path=f"models/{model}",
|
32 |
n_gpu_layers=81,
|
@@ -45,8 +45,6 @@ def respond(
|
|
45 |
settings.stream = True
|
46 |
|
47 |
messages = BasicChatHistory()
|
48 |
-
print("history")
|
49 |
-
print(history)
|
50 |
|
51 |
for msn in history:
|
52 |
user = {
|
@@ -57,8 +55,7 @@ def respond(
|
|
57 |
'role': Roles.assistant,
|
58 |
'content': msn[1]
|
59 |
}
|
60 |
-
|
61 |
-
print(assistant)
|
62 |
messages.add_message(user)
|
63 |
messages.add_message(assistant)
|
64 |
|
@@ -84,7 +81,7 @@ demo = gr.ChatInterface(
|
|
84 |
),
|
85 |
gr.Dropdown(['Meta-Llama-3-70B-Instruct-Q3_K_M.gguf', 'Llama-3-8B-Synthia-v3.5-f16.gguf'], value="Meta-Llama-3-70B-Instruct-Q3_K_M.gguf", label="Model"),
|
86 |
],
|
87 |
-
theme=gr.themes.Soft(primary_hue="green", secondary_hue="indigo", neutral_hue="zinc",font=[gr.themes.GoogleFont("Exo
|
88 |
block_background_fill_dark="*neutral_800"
|
89 |
)
|
90 |
)
|
|
|
26 |
from llama_cpp_agent.providers import LlamaCppPythonProvider
|
27 |
from llama_cpp_agent.chat_history import BasicChatHistory
|
28 |
from llama_cpp_agent.chat_history.messages import Roles
|
29 |
+
|
30 |
llm = Llama(
|
31 |
model_path=f"models/{model}",
|
32 |
n_gpu_layers=81,
|
|
|
45 |
settings.stream = True
|
46 |
|
47 |
messages = BasicChatHistory()
|
|
|
|
|
48 |
|
49 |
for msn in history:
|
50 |
user = {
|
|
|
55 |
'role': Roles.assistant,
|
56 |
'content': msn[1]
|
57 |
}
|
58 |
+
|
|
|
59 |
messages.add_message(user)
|
60 |
messages.add_message(assistant)
|
61 |
|
|
|
81 |
),
|
82 |
gr.Dropdown(['Meta-Llama-3-70B-Instruct-Q3_K_M.gguf', 'Llama-3-8B-Synthia-v3.5-f16.gguf'], value="Meta-Llama-3-70B-Instruct-Q3_K_M.gguf", label="Model"),
|
83 |
],
|
84 |
+
theme=gr.themes.Soft(primary_hue="green", secondary_hue="indigo", neutral_hue="zinc",font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
85 |
block_background_fill_dark="*neutral_800"
|
86 |
)
|
87 |
)
|