Omnibus commited on
Commit
7a99d6a
1 Parent(s): f3d467a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -132,7 +132,7 @@ def comment_generate(prompt, history,post_check,full_conv,persona2, agent_name=a
132
  seed = random.randint(1,1111111111111111)
133
  #agent=prompts.COMMENTER.format(focus=main_point[0])
134
  #bp,_,_=full_conv[0]
135
- agent=prompts.COMMENTER.format(focus=full_conv[0][0],persona=persona2['personality'])
136
  system_prompt=agent
137
  temperature = float(temperature)
138
  if temperature < 1e-2:
@@ -179,7 +179,7 @@ def comment_generate(prompt, history,post_check,full_conv,persona2, agent_name=a
179
  lod = json.loads(r.text)
180
  print(f'lod:: {lod}')
181
  lod[0]['comment']=lod[0]['comment']+1
182
- lod[0]['comment_list'].append({'user':persona2['name'],'datetime':'','comment':output,'reply_list':[]})
183
  #hist_out.append(out_json)
184
  #try:
185
  # for ea in
@@ -209,7 +209,7 @@ def reply_generate(prompt, history,post_check,full_conv,persona1, agent_name=age
209
  print(f'full_conv::\n{full_conv}')
210
  print("###############\nRUNNING REPLY GENERATOR\n###############\n")
211
  seed = random.randint(1,1111111111111111)
212
- agent=prompts.REPLY_TO_COMMENTER.format(focus=full_conv[0][0],comment=full_conv[1][1],persona=persona1['personality'])
213
  system_prompt=agent
214
  temperature = float(temperature)
215
  if temperature < 1e-2:
@@ -253,7 +253,7 @@ def reply_generate(prompt, history,post_check,full_conv,persona1, agent_name=age
253
  lod = json.loads(r.text)
254
  print(f'lod:: {lod}')
255
  lod[0]['reply']=lod[0]['reply']+1
256
- lod[0]['comment_list'][0]['reply_list'].append({'user':persona1['name'],'datetime':'','reply':output})
257
  #hist_out.append(out_json)
258
  #try:
259
  # for ea in
@@ -391,7 +391,7 @@ def generate(prompt, history, post_check,full_conv,persona1, agent_name=agents[0
391
  current_time=current_time.replace(":","-")
392
  current_time=current_time.replace(".","-")
393
  print (current_time)
394
- agent=prompts.BLOG_POSTER.format(persona=persona1['personality'])
395
  system_prompt=agent
396
  temperature = float(temperature)
397
  if temperature < 1e-2:
@@ -496,8 +496,8 @@ def generate(prompt, history, post_check,full_conv,persona1, agent_name=agents[0
496
  full_conv.append((output,None,None))
497
 
498
 
499
- html_out=load_html(full_conv,title,persona1['name'])
500
- post_check={'filename':filename,'user':persona1['name'],'datetime':current_time,'title':title,'blog':1,'comment':0,'reply':0}
501
  yield prompt, history,post_check,full_conv,summary[0],json_obj,json_hist,html_out
502
  else:
503
  print("passing blog")
 
132
  seed = random.randint(1,1111111111111111)
133
  #agent=prompts.COMMENTER.format(focus=main_point[0])
134
  #bp,_,_=full_conv[0]
135
+ agent=prompts.COMMENTER.format(focus=full_conv[0][0],persona=persona[persona2]['personality'])
136
  system_prompt=agent
137
  temperature = float(temperature)
138
  if temperature < 1e-2:
 
179
  lod = json.loads(r.text)
180
  print(f'lod:: {lod}')
181
  lod[0]['comment']=lod[0]['comment']+1
182
+ lod[0]['comment_list'].append({'user':persona[persona2]['name'],'datetime':'','comment':output,'reply_list':[]})
183
  #hist_out.append(out_json)
184
  #try:
185
  # for ea in
 
209
  print(f'full_conv::\n{full_conv}')
210
  print("###############\nRUNNING REPLY GENERATOR\n###############\n")
211
  seed = random.randint(1,1111111111111111)
212
+ agent=prompts.REPLY_TO_COMMENTER.format(focus=full_conv[0][0],comment=full_conv[1][1],persona=persona[persona1]['personality'])
213
  system_prompt=agent
214
  temperature = float(temperature)
215
  if temperature < 1e-2:
 
253
  lod = json.loads(r.text)
254
  print(f'lod:: {lod}')
255
  lod[0]['reply']=lod[0]['reply']+1
256
+ lod[0]['comment_list'][0]['reply_list'].append({'user':persona[persona1]['name'],'datetime':'','reply':output})
257
  #hist_out.append(out_json)
258
  #try:
259
  # for ea in
 
391
  current_time=current_time.replace(":","-")
392
  current_time=current_time.replace(".","-")
393
  print (current_time)
394
+ agent=prompts.BLOG_POSTER.format(persona=persona[persona1]['personality'])
395
  system_prompt=agent
396
  temperature = float(temperature)
397
  if temperature < 1e-2:
 
496
  full_conv.append((output,None,None))
497
 
498
 
499
+ html_out=load_html(full_conv,title,persona[persona1]['name'])
500
+ post_check={'filename':filename,'user':persona[persona1]['name'],'datetime':current_time,'title':title,'blog':1,'comment':0,'reply':0}
501
  yield prompt, history,post_check,full_conv,summary[0],json_obj,json_hist,html_out
502
  else:
503
  print("passing blog")