Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -91,16 +91,6 @@ def chat_inf(system_prompt,prompt,history,memory,client_choice,seed,temp,tokens,
|
|
91 |
print("\n######### HIST "+str(in_len))
|
92 |
print("\n######### TOKENS "+str(tokens))
|
93 |
|
94 |
-
def get_screenshot(chat: list,height=5000,width=600,chatblock=[],theme="light",wait=3000,header=True):
|
95 |
-
print(chatblock)
|
96 |
-
tog = 0
|
97 |
-
if chatblock:
|
98 |
-
tog = 3
|
99 |
-
result = ss_client.predict(str(chat),height,width,chatblock,header,theme,wait,api_name="/run_script")
|
100 |
-
out = f'https://omnibus-html-image-current-tab.hf.space/file={result[tog]}'
|
101 |
-
print(out)
|
102 |
-
return out
|
103 |
-
|
104 |
def clear_fn():
|
105 |
return None,None,None,None
|
106 |
rand_val=random.randint(1,1111111111111111)
|
@@ -143,8 +133,6 @@ with gr.Blocks() as app:
|
|
143 |
client_choice.change(load_models,client_choice,[chat_b])
|
144 |
app.load(load_models,client_choice,[chat_b])
|
145 |
|
146 |
-
im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
147 |
-
|
148 |
chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
149 |
go=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
150 |
|
|
|
91 |
print("\n######### HIST "+str(in_len))
|
92 |
print("\n######### TOKENS "+str(tokens))
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
def clear_fn():
|
95 |
return None,None,None,None
|
96 |
rand_val=random.randint(1,1111111111111111)
|
|
|
133 |
client_choice.change(load_models,client_choice,[chat_b])
|
134 |
app.load(load_models,client_choice,[chat_b])
|
135 |
|
|
|
|
|
136 |
chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
137 |
go=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,memory,client_choice,seed,temp,tokens,top_p,rep_p,chat_mem,custom_prompt],[chat_b,memory])
|
138 |
|