Update app.py
Browse files
app.py
CHANGED
@@ -111,17 +111,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
|
|
111 |
chat_b = gr.Chatbot(show_label=True, show_share_button=True, show_copy_button=True, likeable=True, layout="bubble", bubble_full_width=False)
|
112 |
with gr.Group():
|
113 |
with gr.Row():
|
114 |
-
with gr.Column(
|
115 |
inp = gr.Textbox(label="Prompt")
|
116 |
sys_inp = gr.Textbox(label="System Prompt (optional)")
|
117 |
with gr.Accordion("Prompt Format",open=False):
|
118 |
custom_prompt=gr.Textbox(label="Modify Prompt Format", info="For testing purposes. 'USER_INPUT' is where 'SYSTEM_PROMPT, PROMPT' will be placed", lines=3,value="<start_of_turn>userUSER_INPUT<end_of_turn><start_of_turn>model")
|
119 |
-
with gr.Row():
|
120 |
-
btn = gr.Button("Chat")
|
121 |
-
stop_btn = gr.Button("Stop")
|
122 |
-
clear_btn = gr.Button("Clear")
|
123 |
-
with gr.Column(scale=1):
|
124 |
-
with gr.Group():
|
125 |
rand = gr.Checkbox(label="Random Seed", value=True)
|
126 |
seed=gr.Slider(label="Seed", minimum=1, maximum=1111111111111111,step=1, value=rand_val)
|
127 |
tokens = gr.Slider(label="Max new tokens",value=1600,minimum=0,maximum=8000,step=64,interactive=True, visible=True,info="The maximum number of tokens")
|
@@ -129,6 +123,10 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
|
|
129 |
top_p=gr.Slider(label="Top-P",step=0.01, minimum=0.01, maximum=1.0, value=0.49)
|
130 |
rep_p=gr.Slider(label="Repetition Penalty",step=0.01, minimum=0.1, maximum=2.0, value=0.99)
|
131 |
chat_mem=gr.Number(label="Chat Memory", info="Number of previous chats to retain",value=4)
|
|
|
|
|
|
|
|
|
132 |
|
133 |
chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
134 |
go=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
|
|
111 |
chat_b = gr.Chatbot(show_label=True, show_share_button=True, show_copy_button=True, likeable=True, layout="bubble", bubble_full_width=False)
|
112 |
with gr.Group():
|
113 |
with gr.Row():
|
114 |
+
with gr.Column():
|
115 |
inp = gr.Textbox(label="Prompt")
|
116 |
sys_inp = gr.Textbox(label="System Prompt (optional)")
|
117 |
with gr.Accordion("Prompt Format",open=False):
|
118 |
custom_prompt=gr.Textbox(label="Modify Prompt Format", info="For testing purposes. 'USER_INPUT' is where 'SYSTEM_PROMPT, PROMPT' will be placed", lines=3,value="<start_of_turn>userUSER_INPUT<end_of_turn><start_of_turn>model")
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
rand = gr.Checkbox(label="Random Seed", value=True)
|
120 |
seed=gr.Slider(label="Seed", minimum=1, maximum=1111111111111111,step=1, value=rand_val)
|
121 |
tokens = gr.Slider(label="Max new tokens",value=1600,minimum=0,maximum=8000,step=64,interactive=True, visible=True,info="The maximum number of tokens")
|
|
|
123 |
top_p=gr.Slider(label="Top-P",step=0.01, minimum=0.01, maximum=1.0, value=0.49)
|
124 |
rep_p=gr.Slider(label="Repetition Penalty",step=0.01, minimum=0.1, maximum=2.0, value=0.99)
|
125 |
chat_mem=gr.Number(label="Chat Memory", info="Number of previous chats to retain",value=4)
|
126 |
+
with gr.Row():
|
127 |
+
btn = gr.Button("Chat")
|
128 |
+
stop_btn = gr.Button("Stop")
|
129 |
+
clear_btn = gr.Button("Clear")
|
130 |
|
131 |
chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
132 |
go=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|