Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ def chat_inf(system_prompt,prompt,history,client_choice,seed,temp,tokens,top_p,r
|
|
64 |
hist_len=len(history)
|
65 |
print(hist_len)
|
66 |
in_len=len(system_prompt+prompt)+hist_len
|
67 |
-
print(in_len)
|
68 |
if (in_len+tokens) > 8000:
|
69 |
yield [(prompt,"Wait. I need to compress our Chat history...")]
|
70 |
history=compress_history(history,client_choice,seed,temp,tokens,top_p,rep_p)
|
@@ -137,7 +137,7 @@ with gr.Blocks() as app:
|
|
137 |
with gr.Group():
|
138 |
rand = gr.Checkbox(label="Random Seed", value=True)
|
139 |
seed=gr.Slider(label="Seed", minimum=1, maximum=1111111111111111,step=1, value=rand_val)
|
140 |
-
tokens = gr.Slider(label="Max new tokens",value=
|
141 |
temp=gr.Slider(label="Temperature",step=0.01, minimum=0.01, maximum=1.0, value=0.9)
|
142 |
top_p=gr.Slider(label="Top-P",step=0.01, minimum=0.01, maximum=1.0, value=0.9)
|
143 |
rep_p=gr.Slider(label="Repetition Penalty",step=0.1, minimum=0.1, maximum=2.0, value=1.0)
|
|
|
64 |
hist_len=len(history)
|
65 |
print(hist_len)
|
66 |
in_len=len(system_prompt+prompt)+hist_len
|
67 |
+
print("\n#########"+in_len)
|
68 |
if (in_len+tokens) > 8000:
|
69 |
yield [(prompt,"Wait. I need to compress our Chat history...")]
|
70 |
history=compress_history(history,client_choice,seed,temp,tokens,top_p,rep_p)
|
|
|
137 |
with gr.Group():
|
138 |
rand = gr.Checkbox(label="Random Seed", value=True)
|
139 |
seed=gr.Slider(label="Seed", minimum=1, maximum=1111111111111111,step=1, value=rand_val)
|
140 |
+
tokens = gr.Slider(label="Max new tokens",value=3840,minimum=0,maximum=8000,step=64,interactive=True, visible=True,info="The maximum number of tokens")
|
141 |
temp=gr.Slider(label="Temperature",step=0.01, minimum=0.01, maximum=1.0, value=0.9)
|
142 |
top_p=gr.Slider(label="Top-P",step=0.01, minimum=0.01, maximum=1.0, value=0.9)
|
143 |
rep_p=gr.Slider(label="Repetition Penalty",step=0.1, minimum=0.1, maximum=2.0, value=1.0)
|