Update app.py
Browse files
app.py
CHANGED
@@ -272,7 +272,7 @@ def generate(prompt, history, post_check, agent_name=agents[0], sys_prompt="", t
|
|
272 |
print(f'title:: {title}')
|
273 |
filename=create_valid_filename(f'{current_time}---{title}')
|
274 |
|
275 |
-
out_json = {"prompt":prompt,"output":output}
|
276 |
|
277 |
hist_out.append(out_json)
|
278 |
#try:
|
@@ -297,7 +297,7 @@ def generate(prompt, history, post_check, agent_name=agents[0], sys_prompt="", t
|
|
297 |
history = []
|
298 |
output = compress_history(formatted_prompt)
|
299 |
summary[0]=output
|
300 |
-
sum_json = {
|
301 |
sum_out.append(sum_json)
|
302 |
with open(f'{uid}-sum.json', 'w') as f:
|
303 |
json_obj=json.dumps(sum_out, indent=4)
|
@@ -460,7 +460,7 @@ def generate_OG(prompt, history, agent_name=agents[0], sys_prompt="", temperatur
|
|
460 |
|
461 |
|
462 |
with gr.Blocks() as app:
|
463 |
-
post_handler=gr.State(
|
464 |
html = gr.HTML()
|
465 |
|
466 |
chatbot=gr.Chatbot()
|
|
|
272 |
print(f'title:: {title}')
|
273 |
filename=create_valid_filename(f'{current_time}---{title}')
|
274 |
|
275 |
+
out_json = {'user':"",'datetime':current_time,'title':title,'blog':1,'comment':0,'reply':0,"prompt":prompt,"output":output}
|
276 |
|
277 |
hist_out.append(out_json)
|
278 |
#try:
|
|
|
297 |
history = []
|
298 |
output = compress_history(formatted_prompt)
|
299 |
summary[0]=output
|
300 |
+
sum_json = {"summary":summary[0]}
|
301 |
sum_out.append(sum_json)
|
302 |
with open(f'{uid}-sum.json', 'w') as f:
|
303 |
json_obj=json.dumps(sum_out, indent=4)
|
|
|
460 |
|
461 |
|
462 |
with gr.Blocks() as app:
|
463 |
+
post_handler=gr.State()
|
464 |
html = gr.HTML()
|
465 |
|
466 |
chatbot=gr.Chatbot()
|