Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,17 +14,25 @@ from huggingface_hub import hf_hub_download
|
|
14 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
15 |
|
16 |
hf_hub_download(
|
17 |
-
repo_id="
|
18 |
-
filename="
|
19 |
local_dir="./models"
|
20 |
)
|
21 |
|
22 |
hf_hub_download(
|
23 |
-
repo_id="
|
24 |
-
filename="
|
25 |
local_dir="./models"
|
26 |
)
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
llm = None
|
30 |
llm_model = None
|
@@ -41,7 +49,7 @@ def respond(
|
|
41 |
top_k,
|
42 |
repeat_penalty,
|
43 |
):
|
44 |
-
chat_template = MessagesFormatterType.
|
45 |
|
46 |
global llm
|
47 |
global llm_model
|
@@ -115,13 +123,14 @@ demo = gr.ChatInterface(
|
|
115 |
respond,
|
116 |
additional_inputs=[
|
117 |
gr.Dropdown([
|
118 |
-
'
|
119 |
-
'
|
|
|
120 |
],
|
121 |
-
value="
|
122 |
label="Model"
|
123 |
),
|
124 |
-
gr.Textbox(value="
|
125 |
gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens"),
|
126 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
127 |
gr.Slider(
|
@@ -150,7 +159,7 @@ demo = gr.ChatInterface(
|
|
150 |
undo_btn="Undo",
|
151 |
clear_btn="Clear",
|
152 |
submit_btn="Send",
|
153 |
-
title="Chat with
|
154 |
description=description,
|
155 |
chatbot=gr.Chatbot(
|
156 |
scale=1,
|
|
|
14 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
15 |
|
16 |
hf_hub_download(
|
17 |
+
repo_id="bartowski/gemma-2-9b-it-GGUF",
|
18 |
+
filename="gemma-2-9b-it-Q5_K_M.gguf",
|
19 |
local_dir="./models"
|
20 |
)
|
21 |
|
22 |
hf_hub_download(
|
23 |
+
repo_id="bartowski/gemma-2-27b-it-GGUF",
|
24 |
+
filename="gemma-2-27b-it-Q5_K_M.gguf",
|
25 |
local_dir="./models"
|
26 |
)
|
27 |
|
28 |
+
hf_hub_download(
|
29 |
+
repo_id="google/gemma-2-2b-it-GGUF",
|
30 |
+
filename="2b_it_v2.gguf",
|
31 |
+
local_dir="./models",
|
32 |
+
token=huggingface_token
|
33 |
+
)
|
34 |
+
|
35 |
+
|
36 |
|
37 |
llm = None
|
38 |
llm_model = None
|
|
|
49 |
top_k,
|
50 |
repeat_penalty,
|
51 |
):
|
52 |
+
chat_template = MessagesFormatterType.GEMMA_2
|
53 |
|
54 |
global llm
|
55 |
global llm_model
|
|
|
123 |
respond,
|
124 |
additional_inputs=[
|
125 |
gr.Dropdown([
|
126 |
+
'gemma-2-9b-it-Q5_K_M.gguf',
|
127 |
+
'gemma-2-27b-it-Q5_K_M.gguf',
|
128 |
+
'2b_it_v2.gguf'
|
129 |
],
|
130 |
+
value="2b_it_v2.gguf",
|
131 |
label="Model"
|
132 |
),
|
133 |
+
gr.Textbox(value="You are a helpful assistant.", label="System message"),
|
134 |
gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens"),
|
135 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
136 |
gr.Slider(
|
|
|
159 |
undo_btn="Undo",
|
160 |
clear_btn="Clear",
|
161 |
submit_btn="Send",
|
162 |
+
title="Chat with Gemma 2 using llama.cpp",
|
163 |
description=description,
|
164 |
chatbot=gr.Chatbot(
|
165 |
scale=1,
|