Upload gradio_streamingllm.py
Browse files- gradio_streamingllm.py +12 -4
gradio_streamingllm.py
CHANGED
@@ -45,13 +45,13 @@ with gr.Blocks() as setting:
|
|
45 |
cfg['setting_cache_path'] = gr.Textbox(label="缓存路径", max_lines=1, scale=2, **cfg['setting_cache_path'])
|
46 |
cfg['setting_seed'] = gr.Number(label="随机种子", scale=1, **cfg['setting_seed'])
|
47 |
cfg['setting_n_gpu_layers'] = gr.Number(label="n_gpu_layers", scale=1, **cfg['setting_n_gpu_layers'])
|
48 |
-
with gr.Row():
|
49 |
cfg['setting_ctx'] = gr.Number(label="上下文大小(Tokens)", **cfg['setting_ctx'])
|
50 |
cfg['setting_max_tokens'] = gr.Number(label="最大响应长度(Tokens)", interactive=True,
|
51 |
**cfg['setting_max_tokens'])
|
52 |
cfg['setting_n_keep'] = gr.Number(value=10, label="n_keep", interactive=False)
|
53 |
cfg['setting_n_discard'] = gr.Number(label="n_discard", interactive=True, **cfg['setting_n_discard'])
|
54 |
-
with gr.Row():
|
55 |
cfg['setting_temperature'] = gr.Number(label="温度", interactive=True, **cfg['setting_temperature'])
|
56 |
cfg['setting_repeat_penalty'] = gr.Number(label="重复惩罚", interactive=True, **cfg['setting_repeat_penalty'])
|
57 |
cfg['setting_frequency_penalty'] = gr.Number(label="频率惩罚", interactive=True,
|
@@ -59,13 +59,13 @@ with gr.Blocks() as setting:
|
|
59 |
cfg['setting_presence_penalty'] = gr.Number(label="存在惩罚", interactive=True,
|
60 |
**cfg['setting_presence_penalty'])
|
61 |
cfg['setting_repeat_last_n'] = gr.Number(label="惩罚范围", interactive=True, **cfg['setting_repeat_last_n'])
|
62 |
-
with gr.Row():
|
63 |
cfg['setting_top_k'] = gr.Number(label="Top-K", interactive=True, **cfg['setting_top_k'])
|
64 |
cfg['setting_top_p'] = gr.Number(label="Top P", interactive=True, **cfg['setting_top_p'])
|
65 |
cfg['setting_min_p'] = gr.Number(label="Min P", interactive=True, **cfg['setting_min_p'])
|
66 |
cfg['setting_typical_p'] = gr.Number(label="Typical", interactive=True, **cfg['setting_typical_p'])
|
67 |
cfg['setting_tfs_z'] = gr.Number(label="TFS", interactive=True, **cfg['setting_tfs_z'])
|
68 |
-
with gr.Row():
|
69 |
cfg['setting_mirostat_mode'] = gr.Number(label="Mirostat 模式", **cfg['setting_mirostat_mode'])
|
70 |
cfg['setting_mirostat_eta'] = gr.Number(label="Mirostat 学习率", interactive=True,
|
71 |
**cfg['setting_mirostat_eta'])
|
@@ -154,6 +154,14 @@ custom_css = r'''
|
|
154 |
#prompt > label > textarea {
|
155 |
max-height: 63px;
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
'''
|
158 |
|
159 |
# ========== 开始运行 ==========
|
|
|
45 |
cfg['setting_cache_path'] = gr.Textbox(label="缓存路径", max_lines=1, scale=2, **cfg['setting_cache_path'])
|
46 |
cfg['setting_seed'] = gr.Number(label="随机种子", scale=1, **cfg['setting_seed'])
|
47 |
cfg['setting_n_gpu_layers'] = gr.Number(label="n_gpu_layers", scale=1, **cfg['setting_n_gpu_layers'])
|
48 |
+
with gr.Row(elem_classes='setting'):
|
49 |
cfg['setting_ctx'] = gr.Number(label="上下文大小(Tokens)", **cfg['setting_ctx'])
|
50 |
cfg['setting_max_tokens'] = gr.Number(label="最大响应长度(Tokens)", interactive=True,
|
51 |
**cfg['setting_max_tokens'])
|
52 |
cfg['setting_n_keep'] = gr.Number(value=10, label="n_keep", interactive=False)
|
53 |
cfg['setting_n_discard'] = gr.Number(label="n_discard", interactive=True, **cfg['setting_n_discard'])
|
54 |
+
with gr.Row(elem_classes='setting'):
|
55 |
cfg['setting_temperature'] = gr.Number(label="温度", interactive=True, **cfg['setting_temperature'])
|
56 |
cfg['setting_repeat_penalty'] = gr.Number(label="重复惩罚", interactive=True, **cfg['setting_repeat_penalty'])
|
57 |
cfg['setting_frequency_penalty'] = gr.Number(label="频率惩罚", interactive=True,
|
|
|
59 |
cfg['setting_presence_penalty'] = gr.Number(label="存在惩罚", interactive=True,
|
60 |
**cfg['setting_presence_penalty'])
|
61 |
cfg['setting_repeat_last_n'] = gr.Number(label="惩罚范围", interactive=True, **cfg['setting_repeat_last_n'])
|
62 |
+
with gr.Row(elem_classes='setting'):
|
63 |
cfg['setting_top_k'] = gr.Number(label="Top-K", interactive=True, **cfg['setting_top_k'])
|
64 |
cfg['setting_top_p'] = gr.Number(label="Top P", interactive=True, **cfg['setting_top_p'])
|
65 |
cfg['setting_min_p'] = gr.Number(label="Min P", interactive=True, **cfg['setting_min_p'])
|
66 |
cfg['setting_typical_p'] = gr.Number(label="Typical", interactive=True, **cfg['setting_typical_p'])
|
67 |
cfg['setting_tfs_z'] = gr.Number(label="TFS", interactive=True, **cfg['setting_tfs_z'])
|
68 |
+
with gr.Row(elem_classes='setting'):
|
69 |
cfg['setting_mirostat_mode'] = gr.Number(label="Mirostat 模式", **cfg['setting_mirostat_mode'])
|
70 |
cfg['setting_mirostat_eta'] = gr.Number(label="Mirostat 学习率", interactive=True,
|
71 |
**cfg['setting_mirostat_eta'])
|
|
|
154 |
#prompt > label > textarea {
|
155 |
max-height: 63px;
|
156 |
}
|
157 |
+
.setting label {
|
158 |
+
display: flex;
|
159 |
+
flex-direction: column;
|
160 |
+
height: 100%;
|
161 |
+
}
|
162 |
+
.setting input {
|
163 |
+
margin-top: auto;
|
164 |
+
}
|
165 |
'''
|
166 |
|
167 |
# ========== 开始运行 ==========
|