Spaces:
Sleeping
Sleeping
change models
Browse files- app.py +15 -30
- requirements.txt +3 -2
app.py
CHANGED
@@ -10,29 +10,23 @@ from llama_cpp_agent.chat_history.messages import Roles
|
|
10 |
import gradio as gr
|
11 |
from huggingface_hub import hf_hub_download
|
12 |
|
13 |
-
|
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="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="
|
30 |
-
filename="
|
31 |
-
local_dir="./models",
|
32 |
-
token=huggingface_token
|
33 |
-
)
|
34 |
-
|
35 |
|
|
|
|
|
36 |
|
37 |
llm = None
|
38 |
llm_model = None
|
@@ -108,26 +102,17 @@ def respond(
|
|
108 |
outputs += output
|
109 |
yield outputs
|
110 |
|
111 |
-
description = """<p align="center">Defaults
|
112 |
-
<p><center>
|
113 |
-
<a href="https://huggingface.co/google/gemma-2-27b-it" target="_blank">[27B it Model]</a>
|
114 |
-
<a href="https://huggingface.co/google/gemma-2-9b-it" target="_blank">[9B it Model]</a>
|
115 |
-
<a href="https://huggingface.co/google/gemma-2-2b-it" target="_blank">[2B it Model]</a>
|
116 |
-
<a href="https://huggingface.co/bartowski/gemma-2-27b-it-GGUF" target="_blank">[27B it Model GGUF]</a>
|
117 |
-
<a href="https://huggingface.co/bartowski/gemma-2-9b-it-GGUF" target="_blank">[9B it Model GGUF]</a>
|
118 |
-
<a href="https://huggingface.co/google/gemma-2-2b-it-GGUF" target="_blank">[2B it Model GGUF]</a>
|
119 |
-
</center></p>
|
120 |
"""
|
121 |
|
122 |
demo = gr.ChatInterface(
|
123 |
respond,
|
124 |
additional_inputs=[
|
125 |
gr.Dropdown([
|
126 |
-
'
|
127 |
-
'
|
128 |
-
'2b_it_v2.gguf'
|
129 |
],
|
130 |
-
value="
|
131 |
label="Model"
|
132 |
),
|
133 |
gr.Textbox(value="You are a helpful assistant.", label="System message"),
|
@@ -159,7 +144,7 @@ demo = gr.ChatInterface(
|
|
159 |
undo_btn="Undo",
|
160 |
clear_btn="Clear",
|
161 |
submit_btn="Send",
|
162 |
-
title="Chat with
|
163 |
description=description,
|
164 |
chatbot=gr.Chatbot(
|
165 |
scale=1,
|
|
|
10 |
import gradio as gr
|
11 |
from huggingface_hub import hf_hub_download
|
12 |
|
|
|
13 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
14 |
|
15 |
hf_hub_download(
|
16 |
+
repo_id="Qwen/Qwen2-0.5B-Instruct-GGUF",
|
17 |
+
filename="qwen2-0_5b-instruct-q4_k_m.gguf",
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
local_dir="./models"
|
19 |
)
|
20 |
|
21 |
+
#hf_hub_download(
|
22 |
+
# repo_id="TobDeBer/Meta-Llama-3.1-8B-Instruct-Q4_K_M-GGUF",
|
23 |
+
# filename="meta-llama-3.1-8b-instruct-q4_k_m.gguf",
|
24 |
+
# local_dir="./models",
|
25 |
+
# token=huggingface_token
|
26 |
+
#)
|
|
|
27 |
|
28 |
+
# TobDeBer/granite-8b-code-instruct-128k-Q4_K_M-GGUF
|
29 |
+
# granite-8b-code-instruct-128k-q4_k_m.gguf
|
30 |
|
31 |
llm = None
|
32 |
llm_model = None
|
|
|
102 |
outputs += output
|
103 |
yield outputs
|
104 |
|
105 |
+
description = """<p align="center">Defaults Qwen 500M</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
"""
|
107 |
|
108 |
demo = gr.ChatInterface(
|
109 |
respond,
|
110 |
additional_inputs=[
|
111 |
gr.Dropdown([
|
112 |
+
'meta-llama-3.1-8b-instruct-q4_k_m.gguf',
|
113 |
+
'qwen2-0_5b-instruct-q4_k_m.gguf'
|
|
|
114 |
],
|
115 |
+
value="qwen2-0_5b-instruct-q4_k_m.gguf",
|
116 |
label="Model"
|
117 |
),
|
118 |
gr.Textbox(value="You are a helpful assistant.", label="System message"),
|
|
|
144 |
undo_btn="Undo",
|
145 |
clear_btn="Clear",
|
146 |
submit_btn="Send",
|
147 |
+
title="Chat with Qwen 2 using llama.cpp",
|
148 |
description=description,
|
149 |
chatbot=gr.Chatbot(
|
150 |
scale=1,
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
|
|
|
2 |
scikit-build-core
|
3 |
https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.81-cu124/llama_cpp_python-0.2.81-cp310-cp310-linux_x86_64.whl
|
4 |
-
llama-cpp-agent>=0.2.25
|
|
|
1 |
+
spaces
|
2 |
+
huggingface_hub
|
3 |
scikit-build-core
|
4 |
https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.81-cu124/llama_cpp_python-0.2.81-cp310-cp310-linux_x86_64.whl
|
5 |
+
llama-cpp-agent>=0.2.25
|