Omnibus commited on
Commit
779cc8b
1 Parent(s): 4ee8a57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -8,17 +8,17 @@ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
8
 
9
  html_user="""
10
  <div class="user_chat">
11
- {chat}
12
  </div>
13
  """
14
  html_bot="""
15
  <div class="bot_chat">
16
- {chat}
17
  </div>
18
  """
19
  html_card="""
20
  <div class="chat_card">
21
- {body}
22
  </div>
23
  """
24
 
@@ -29,9 +29,9 @@ def get_screenshot(chat,css=None):
29
  for user,bot in chat:
30
  print (f'user::{user}')
31
  print (f'bot::{bot}')
32
- html_body += html_user.format(chat=user)
33
- html_body += html_bot.format(chat=bot)
34
- html=html_card.format(body=html_body)
35
  #css = css
36
  #hti.screenshot(html_str=html, save_as='red_page.png')
37
  #hti.screenshot(html_str=html_card, css_str=css, save_as='red_page.png')
 
8
 
9
  html_user="""
10
  <div class="user_chat">
11
+ $chat
12
  </div>
13
  """
14
  html_bot="""
15
  <div class="bot_chat">
16
+ $chat
17
  </div>
18
  """
19
  html_card="""
20
  <div class="chat_card">
21
+ $body
22
  </div>
23
  """
24
 
 
29
  for user,bot in chat:
30
  print (f'user::{user}')
31
  print (f'bot::{bot}')
32
+ html_body += html_user.replace("$chat",user)
33
+ html_body += html_bot.replace("$chat",bot)
34
+ html=html_card.replace("$body",html_body)
35
  #css = css
36
  #hti.screenshot(html_str=html, save_as='red_page.png')
37
  #hti.screenshot(html_str=html_card, css_str=css, save_as='red_page.png')