Update app.py
Browse files
app.py
CHANGED
@@ -151,7 +151,7 @@ def create_valid_filename(invalid_filename: str) -> str:
|
|
151 |
|
152 |
|
153 |
|
154 |
-
def load_html(inp):
|
155 |
ht=""
|
156 |
if inp:
|
157 |
for ea in inp:
|
@@ -159,12 +159,13 @@ def load_html(inp):
|
|
159 |
print(f'outp:: {outp}')
|
160 |
print(f'prom:: {prom}')
|
161 |
ht+=f"""<div class="div_box">
|
162 |
-
<div class="
|
163 |
-
<div class="
|
164 |
</div>"""
|
165 |
with open('index.html','r') as h:
|
166 |
html=h.read()
|
167 |
html = html.replace("$body",f"{ht}")
|
|
|
168 |
h.close()
|
169 |
return html
|
170 |
|
@@ -297,7 +298,7 @@ def generate(prompt, history, agent_name=agents[0], sys_prompt="", temperature=0
|
|
297 |
full_conv.append((output,prompt))
|
298 |
|
299 |
|
300 |
-
html_out=load_html(full_conv)
|
301 |
yield prompt, history, summary[0],json_obj,json_hist,html_out
|
302 |
return prompt, history, summary[0],json_obj,json_hist,html_out
|
303 |
|
|
|
151 |
|
152 |
|
153 |
|
154 |
+
def load_html(inp,title):
|
155 |
ht=""
|
156 |
if inp:
|
157 |
for ea in inp:
|
|
|
159 |
print(f'outp:: {outp}')
|
160 |
print(f'prom:: {prom}')
|
161 |
ht+=f"""<div class="div_box">
|
162 |
+
<div class="resp1">{outp}</div>
|
163 |
+
<div class="resp2">{prom}</div>
|
164 |
</div>"""
|
165 |
with open('index.html','r') as h:
|
166 |
html=h.read()
|
167 |
html = html.replace("$body",f"{ht}")
|
168 |
+
html = html.replace("$body",f"{title}")
|
169 |
h.close()
|
170 |
return html
|
171 |
|
|
|
298 |
full_conv.append((output,prompt))
|
299 |
|
300 |
|
301 |
+
html_out=load_html(full_conv,title)
|
302 |
yield prompt, history, summary[0],json_obj,json_hist,html_out
|
303 |
return prompt, history, summary[0],json_obj,json_hist,html_out
|
304 |
|