Omnibus commited on
Commit
e9b35b6
1 Parent(s): a8e5a5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -13
app.py CHANGED
@@ -166,9 +166,15 @@ def comment_generate(prompt, history,post_check,full_conv,persona2, agent_name=a
166
  print(type(comment_cnt))
167
  post_check['comment']=comment_cnt+1
168
 
169
- comment_json= {'user':persona[persona2]['name'],'datetime':current_time,'comment':output,'reply_list':[]}
 
 
170
 
171
- out_json = {'user':persona[persona1]['name'],'datetime':post_check['datetime'],'file_name':post_check['filename'],
 
 
 
 
172
  'title':post_check['title'],'blog':1,'comment':post_check['comment']+1,'reply':post_check['reply'],
173
  "prompt":post_check['prompt'],"output":post_check['output'],'comment_list':post_check['comment_list'].append(comment_json)}
174
 
@@ -335,18 +341,18 @@ def create_valid_filename(invalid_filename: str) -> str:
335
 
336
  def load_html(inp,conv):
337
  ht=""
338
- for i,ea in enumerate(inp):
339
 
340
- blog,comm,repl=ea
341
- #print(f'outp:: {outp}')
342
- #print(f'prom:: {prom}')
343
- ht+=f"""<div class="div_box">"""
344
- ht+=f"""<pre class="bpost"><div class="bhead"><h2>{conv['title']}</h2><br><h5>{conv['user']}</h5></div>{conv['output']}</pre>"""
345
- for
346
- ht+=f"""<pre class="resp1"><div class="bhead"></div>{comm}</pre>"""
347
- if repl:
348
- ht+=f"""<pre class="resp2"><div class="bhead"></div>{repl}</pre>"""
349
- ht+=f"""</div>"""
350
  '''
351
  if inp:
352
  for i,ea in enumerate(inp):
 
166
  print(type(comment_cnt))
167
  post_check['comment']=comment_cnt+1
168
 
169
+
170
+
171
+ reply_json= {'user':'','datetime':'','reply':''}
172
 
173
+ #comment_json= {'user':'','datetime':'','comment':'','reply_list':[reply_json]}
174
+
175
+ comment_json= {'user':persona[persona2]['name'],'datetime':current_time,'comment':output,'reply_list':[reply_json]}
176
+
177
+ out_json = {'user':post_check['user'],'datetime':post_check['datetime'],'file_name':post_check['filename'],
178
  'title':post_check['title'],'blog':1,'comment':post_check['comment']+1,'reply':post_check['reply'],
179
  "prompt":post_check['prompt'],"output":post_check['output'],'comment_list':post_check['comment_list'].append(comment_json)}
180
 
 
341
 
342
  def load_html(inp,conv):
343
  ht=""
344
+ #for i,ea in enumerate(inp):
345
 
346
+ #blog,comm,repl=ea
347
+ #print(f'outp:: {outp}')
348
+ #print(f'prom:: {prom}')
349
+ ht+=f"""<div class="div_box">"""
350
+ ht+=f"""<pre class="bpost"><div class="bhead"><h2>{conv['title']}</h2><br><h5>{conv['user']}</h5></div>{conv['output']}</pre>"""
351
+ for com in conv['comment_list']:
352
+ ht+=f"""<pre class="resp1"><div class="bhead"></div>{com}</pre>"""
353
+ for repl in conv['comment_list']['reply_list']:
354
+ ht+=f"""<pre class="resp2"><div class="bhead"></div>{repl}</pre>"""
355
+ ht+=f"""</div>"""
356
  '''
357
  if inp:
358
  for i,ea in enumerate(inp):