Update app.py
Browse files
app.py
CHANGED
@@ -2,25 +2,21 @@ import gradio as gr
|
|
2 |
from gpt4all import GPT4All
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
|
5 |
-
title = "
|
6 |
description = """
|
7 |
Infer service
|
8 |
"""
|
9 |
|
10 |
-
model_path = "
|
11 |
-
model_name = "
|
12 |
-
hf_hub_download(repo_id="
|
13 |
|
14 |
print("Start the model init process")
|
15 |
model = model = GPT4All(model_name, model_path, allow_download = True, device="cpu")
|
16 |
print("Finish the model init process")
|
17 |
|
18 |
-
model.config["promptTemplate"] =
|
19 |
-
|
20 |
-
<|im_start|>assistant
|
21 |
-
|
22 |
-
'''
|
23 |
-
model.config["systemPrompt"] = "You are a helpful assistant named 安风."
|
24 |
model._is_chat_session_activated = True
|
25 |
|
26 |
max_new_tokens = 2048
|
@@ -80,13 +76,7 @@ iface = gr.ChatInterface(
|
|
80 |
title=title,
|
81 |
description = description,
|
82 |
additional_inputs=additional_inputs,
|
83 |
-
|
84 |
-
["Can you tell me how the Namib Desert Beetle inspires water collection methods?"],
|
85 |
-
["I'm working on a project related to sustainable architecture. How can biomimicry guide my design process?"],
|
86 |
-
["Can you explain the concept of biomimicry and its importance in today’s world?"],
|
87 |
-
["I need some ideas for a biomimicry project in my biology class. Can you suggest some organisms to study?"],
|
88 |
-
["How does the structure of a lotus leaf help in creating self-cleaning surfaces?"]
|
89 |
-
]
|
90 |
)
|
91 |
|
92 |
|
|
|
2 |
from gpt4all import GPT4All
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
|
5 |
+
title = "兮辞"
|
6 |
description = """
|
7 |
Infer service
|
8 |
"""
|
9 |
|
10 |
+
model_path = "TheBloke/openbuddy-zephyr-7B-v14.1-GGUF"
|
11 |
+
model_name = "openbuddy-zephyr-7b-v14.1.Q4_K_M.gguf"
|
12 |
+
hf_hub_download(repo_id="TheBloke/openbuddy-zephyr-7B-v14.1-GGUF", filename=model_name, local_dir=model_path, local_dir_use_symlinks=True)
|
13 |
|
14 |
print("Start the model init process")
|
15 |
model = model = GPT4All(model_name, model_path, allow_download = True, device="cpu")
|
16 |
print("Finish the model init process")
|
17 |
|
18 |
+
model.config["promptTemplate"] = "[INST] {0} [/INST]"
|
19 |
+
model.config["systemPrompt"] = "You are a helpful assistant named 兮辞."
|
|
|
|
|
|
|
|
|
20 |
model._is_chat_session_activated = True
|
21 |
|
22 |
max_new_tokens = 2048
|
|
|
76 |
title=title,
|
77 |
description = description,
|
78 |
additional_inputs=additional_inputs,
|
79 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
)
|
81 |
|
82 |
|