Update app.py
Browse files
app.py
CHANGED
|
@@ -45,8 +45,8 @@ def get_system_tokens(model):
|
|
| 45 |
return get_message_tokens(model, **system_message)
|
| 46 |
|
| 47 |
|
| 48 |
-
repo_name = "
|
| 49 |
-
model_name = "
|
| 50 |
|
| 51 |
snapshot_download(repo_id=repo_name, local_dir=".", allow_patterns=model_name)
|
| 52 |
|
|
@@ -56,7 +56,7 @@ model = Llama(
|
|
| 56 |
n_parts=1,
|
| 57 |
)
|
| 58 |
|
| 59 |
-
max_new_tokens =
|
| 60 |
|
| 61 |
def user(message, history):
|
| 62 |
new_history = history + [[message, None]]
|
|
@@ -123,7 +123,7 @@ with gr.Blocks(
|
|
| 123 |
submit = gr.Button("Submit / 开凹!")
|
| 124 |
stop = gr.Button("Stop / 全局时空断裂")
|
| 125 |
clear = gr.Button("Clear / 打扫群内垃圾")
|
| 126 |
-
with gr.
|
| 127 |
with gr.Column(min_width=80, scale=1):
|
| 128 |
with gr.Tab(label="设置参数"):
|
| 129 |
top_p = gr.Slider(
|
|
@@ -145,13 +145,14 @@ with gr.Blocks(
|
|
| 145 |
temp = gr.Slider(
|
| 146 |
minimum=0.0,
|
| 147 |
maximum=2.0,
|
| 148 |
-
value=0.
|
| 149 |
step=0.01,
|
| 150 |
interactive=True,
|
| 151 |
-
label="情感温度"
|
| 152 |
)
|
| 153 |
with gr.Column():
|
| 154 |
-
system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=
|
|
|
|
| 155 |
with gr.Row():
|
| 156 |
gr.Markdown(
|
| 157 |
"""警告:该模型可能会生成事实上或道德上不正确的文本。NLPark和 Cecilia 对此不承担任何责任。"""
|
|
|
|
| 45 |
return get_message_tokens(model, **system_message)
|
| 46 |
|
| 47 |
|
| 48 |
+
repo_name = "afrideva/MiniChat-3B-GGUF"
|
| 49 |
+
model_name = "minichat-3b.q5_k_m.gguf"
|
| 50 |
|
| 51 |
snapshot_download(repo_id=repo_name, local_dir=".", allow_patterns=model_name)
|
| 52 |
|
|
|
|
| 56 |
n_parts=1,
|
| 57 |
)
|
| 58 |
|
| 59 |
+
max_new_tokens = 4096
|
| 60 |
|
| 61 |
def user(message, history):
|
| 62 |
new_history = history + [[message, None]]
|
|
|
|
| 123 |
submit = gr.Button("Submit / 开凹!")
|
| 124 |
stop = gr.Button("Stop / 全局时空断裂")
|
| 125 |
clear = gr.Button("Clear / 打扫群内垃圾")
|
| 126 |
+
with gr.Accordion(label='进阶设置/Advanced options', open=False):
|
| 127 |
with gr.Column(min_width=80, scale=1):
|
| 128 |
with gr.Tab(label="设置参数"):
|
| 129 |
top_p = gr.Slider(
|
|
|
|
| 145 |
temp = gr.Slider(
|
| 146 |
minimum=0.0,
|
| 147 |
maximum=2.0,
|
| 148 |
+
value=0.5,
|
| 149 |
step=0.01,
|
| 150 |
interactive=True,
|
| 151 |
+
label="情感温度 / Temperature"
|
| 152 |
)
|
| 153 |
with gr.Column():
|
| 154 |
+
system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=True)
|
| 155 |
+
|
| 156 |
with gr.Row():
|
| 157 |
gr.Markdown(
|
| 158 |
"""警告:该模型可能会生成事实上或道德上不正确的文本。NLPark和 Cecilia 对此不承担任何责任。"""
|