Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,60 +133,68 @@ description = """<p align="center">Defaults to Oumuamua-7b-RP (you can switch to
|
|
| 133 |
</center></p>
|
| 134 |
"""
|
| 135 |
|
| 136 |
-
# 各モデルに対応する説明を定義
|
| 137 |
-
model_descriptions = {
|
| 138 |
-
"Oumuamua-7b-RP_Q4_K_M.gguf": "This is the Oumuamua-7b-RP_Q4_K_M model description.",
|
| 139 |
-
"Oumuamua-7b-instruct-v2-Q4_K_M.gguf": "This is the Oumuamua-7b-instruct-v2-Q4_K_M model description.",
|
| 140 |
-
"umiyuki-Umievo-itr012-Gleipnir-7B-Q4_K_M.gguf": "This is the umiyuki-Umievo-itr012-Gleipnir-7B-Q4_K_M model description.",
|
| 141 |
-
"Ninja-V3-Q4_K_M.gguf": "This is the Ninja-V3-Q4_K_M model description.",
|
| 142 |
-
"kagemusya-7b-v1Q8_0.gguf": "This is the kagemusya-7b-v1Q8_0 model description.",
|
| 143 |
-
"Llama-3-ELYZA-JP-8B-q4_k_m.gguf": "This is the Llama-3-ELYZA-JP-8B-q4_k_m model description."
|
| 144 |
-
}
|
| 145 |
-
|
| 146 |
templates = [
|
| 147 |
"MISTRAL", "CHATML", "VICUNA", "LLAMA_2", "SYNTHIA",
|
| 148 |
"NEURAL_CHAT", "SOLAR", "OPEN_CHAT", "ALPACA", "CODE_DS",
|
| 149 |
"B22", "LLAMA_3", "PHI_3"
|
| 150 |
]
|
| 151 |
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
)
|
|
|
|
| 190 |
|
| 191 |
if __name__ == "__main__":
|
| 192 |
demo.launch()
|
|
|
|
| 133 |
</center></p>
|
| 134 |
"""
|
| 135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
templates = [
|
| 137 |
"MISTRAL", "CHATML", "VICUNA", "LLAMA_2", "SYNTHIA",
|
| 138 |
"NEURAL_CHAT", "SOLAR", "OPEN_CHAT", "ALPACA", "CODE_DS",
|
| 139 |
"B22", "LLAMA_3", "PHI_3"
|
| 140 |
]
|
| 141 |
|
| 142 |
+
demo = gr.ChatInterface(
|
| 143 |
+
respond,
|
| 144 |
+
additional_inputs=[
|
| 145 |
+
gr.Dropdown([
|
| 146 |
+
'Oumuamua-7b-RP_Q4_K_M.gguf',
|
| 147 |
+
'Oumuamua-7b-instruct-v2-Q4_K_M.gguf',
|
| 148 |
+
'umiyuki-Umievo-itr012-Gleipnir-7B-Q4_K_M.gguf',
|
| 149 |
+
'Ninja-V3-Q4_K_M.gguf',
|
| 150 |
+
'kagemusya-7b-v1Q8_0.gguf',
|
| 151 |
+
'Llama-3-ELYZA-JP-8B-q4_k_m.gguf'
|
| 152 |
+
],
|
| 153 |
+
value="Oumuamua-7b-RP_Q4_K_M.gguf",
|
| 154 |
+
label="Model"
|
| 155 |
+
),
|
| 156 |
+
gr.Dropdown(
|
| 157 |
+
choices=templates,
|
| 158 |
+
value="LLAMA_2",
|
| 159 |
+
label="Template"
|
| 160 |
+
),
|
| 161 |
+
gr.Textbox(value="You are a helpful assistant.", label="System message"),
|
| 162 |
+
gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens"),
|
| 163 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 164 |
+
gr.Slider(
|
| 165 |
+
minimum=0.1,
|
| 166 |
+
maximum=1.0,
|
| 167 |
+
value=0.95,
|
| 168 |
+
step=0.05,
|
| 169 |
+
label="Top-p",
|
| 170 |
+
),
|
| 171 |
+
gr.Slider(
|
| 172 |
+
minimum=0,
|
| 173 |
+
maximum=100,
|
| 174 |
+
value=40,
|
| 175 |
+
step=1,
|
| 176 |
+
label="Top-k",
|
| 177 |
+
),
|
| 178 |
+
gr.Slider(
|
| 179 |
+
minimum=0.0,
|
| 180 |
+
maximum=2.0,
|
| 181 |
+
value=1.1,
|
| 182 |
+
step=0.1,
|
| 183 |
+
label="Repetition penalty",
|
| 184 |
+
),
|
| 185 |
+
],
|
| 186 |
+
retry_btn="Retry",
|
| 187 |
+
undo_btn="Undo",
|
| 188 |
+
clear_btn="Clear",
|
| 189 |
+
submit_btn="Send",
|
| 190 |
+
title="Chat with various models using llama.cpp",
|
| 191 |
+
description=description,
|
| 192 |
+
chatbot=gr.Chatbot(
|
| 193 |
+
scale=1,
|
| 194 |
+
likeable=False,
|
| 195 |
+
show_copy_button=True
|
| 196 |
)
|
| 197 |
+
)
|
| 198 |
|
| 199 |
if __name__ == "__main__":
|
| 200 |
demo.launch()
|