Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,7 +54,7 @@ def format_prompt(message, history):
|
|
| 54 |
result = []
|
| 55 |
|
| 56 |
|
| 57 |
-
def chat_inf(system_prompt,prompt,history,
|
| 58 |
#token max=8192
|
| 59 |
hist_len=0
|
| 60 |
client=clients[int(client_choice)-1]
|
|
@@ -98,7 +98,7 @@ def chat_inf(system_prompt,prompt,history,memory,client_choice,seed,temp,tokens,
|
|
| 98 |
yield [(prompt,output)]
|
| 99 |
history.append((prompt,output))
|
| 100 |
memory=history
|
| 101 |
-
yield history
|
| 102 |
|
| 103 |
def get_screenshot(chat: list,height=5000,width=600,chatblock=[],theme="light",wait=3000,header=True):
|
| 104 |
print(chatblock)
|
|
@@ -168,7 +168,7 @@ with gr.Blocks() as app:
|
|
| 168 |
im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
| 169 |
chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem],chat_b)
|
| 170 |
|
| 171 |
-
go=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,
|
| 172 |
|
| 173 |
stop_btn.click(None,None,None,cancels=[go,im_go,chat_sub])
|
| 174 |
clear_btn.click(clear_fn,None,[inp,sys_inp,chat_b])
|
|
|
|
| 54 |
result = []
|
| 55 |
|
| 56 |
|
| 57 |
+
def chat_inf(system_prompt,prompt,history,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem):
|
| 58 |
#token max=8192
|
| 59 |
hist_len=0
|
| 60 |
client=clients[int(client_choice)-1]
|
|
|
|
| 98 |
yield [(prompt,output)]
|
| 99 |
history.append((prompt,output))
|
| 100 |
memory=history
|
| 101 |
+
yield history
|
| 102 |
|
| 103 |
def get_screenshot(chat: list,height=5000,width=600,chatblock=[],theme="light",wait=3000,header=True):
|
| 104 |
print(chatblock)
|
|
|
|
| 168 |
im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
| 169 |
chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem],chat_b)
|
| 170 |
|
| 171 |
+
go=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem],[chat_b])
|
| 172 |
|
| 173 |
stop_btn.click(None,None,None,cancels=[go,im_go,chat_sub])
|
| 174 |
clear_btn.click(clear_fn,None,[inp,sys_inp,chat_b])
|