Omnibus commited on
Commit
3add84f
1 Parent(s): 1071c79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -198,6 +198,26 @@ def create_valid_filename(invalid_filename: str) -> str:
198
 
199
 
200
  def load_html(inp,title):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  ht=""
202
  if inp:
203
  for i,ea in enumerate(inp):
@@ -326,7 +346,7 @@ def generate(prompt, history, post_check, agent_name=agents[0], sys_prompt="", t
326
 
327
  #prompt = question_generate(output, history)
328
  #main_point[0]=prompt
329
- full_conv.append((output,prompt))
330
 
331
 
332
  html_out=load_html(full_conv,title)
 
198
 
199
 
200
  def load_html(inp,title):
201
+ ht=""
202
+ if inp:
203
+ for i,ea in enumerate(inp):
204
+
205
+ blog,comm,repl=ea
206
+ #print(f'outp:: {outp}')
207
+ #print(f'prom:: {prom}')
208
+ ht+=f"""<div class="div_box">
209
+ <pre class="bpost">{blog}</pre>
210
+ <pre class="resp1">{comm}</pre>
211
+ <pre class="resp2">{repl}</pre>
212
+ </div>"""
213
+ with open('index.html','r') as h:
214
+ html=h.read()
215
+ html = html.replace("$body",f"{ht}")
216
+ html = html.replace("$title",f"{title}")
217
+ h.close()
218
+ return html
219
+
220
+ def load_html_OG(inp,title):
221
  ht=""
222
  if inp:
223
  for i,ea in enumerate(inp):
 
346
 
347
  #prompt = question_generate(output, history)
348
  #main_point[0]=prompt
349
+ full_conv.append((output,None,None))
350
 
351
 
352
  html_out=load_html(full_conv,title)