Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
|
7 |
|
8 |
css="""
|
9 |
.user_chat{
|
10 |
-
background:
|
11 |
border-radius: 10px 10px 0px 10px;
|
12 |
padding: 10px;
|
13 |
max-width: 100%;
|
@@ -17,7 +17,7 @@ css="""
|
|
17 |
|
18 |
}
|
19 |
.bot_chat{
|
20 |
-
background: #1c3c9b;
|
21 |
border-radius: 10px 10px 10px 0px;
|
22 |
padding: 10px;
|
23 |
max-width: 100%;
|
@@ -28,7 +28,7 @@ css="""
|
|
28 |
}
|
29 |
.chat_card{
|
30 |
background: #253251; #background_c
|
31 |
-
color:#FFFFFF; #font_c
|
32 |
border-radius: 15px;
|
33 |
border-width: thin;
|
34 |
padding: 15px;
|
@@ -72,7 +72,7 @@ def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
|
|
72 |
print(user_c)
|
73 |
if user_c:
|
74 |
user_c=user_c.strip('""').strip("''")
|
75 |
-
|
76 |
html_body=""
|
77 |
for user,bot in chat:
|
78 |
html_body += html_user.replace("$chat",user)
|
@@ -82,7 +82,7 @@ def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
|
|
82 |
filename=f'{make_filename(chat[0][0])}.png'
|
83 |
print(filename)
|
84 |
hti.screenshot(html_str=html, css_str=css_in, save_as=filename)
|
85 |
-
return filename,html
|
86 |
|
87 |
|
88 |
def format_prompt(message, history):
|
|
|
7 |
|
8 |
css="""
|
9 |
.user_chat{
|
10 |
+
background: $user_c;
|
11 |
border-radius: 10px 10px 0px 10px;
|
12 |
padding: 10px;
|
13 |
max-width: 100%;
|
|
|
17 |
|
18 |
}
|
19 |
.bot_chat{
|
20 |
+
background: #1c3c9b;
|
21 |
border-radius: 10px 10px 10px 0px;
|
22 |
padding: 10px;
|
23 |
max-width: 100%;
|
|
|
28 |
}
|
29 |
.chat_card{
|
30 |
background: #253251; #background_c
|
31 |
+
color:#FFFFFF; #font_c;
|
32 |
border-radius: 15px;
|
33 |
border-width: thin;
|
34 |
padding: 15px;
|
|
|
72 |
print(user_c)
|
73 |
if user_c:
|
74 |
user_c=user_c.strip('""').strip("''")
|
75 |
+
css_in=css_in.replace("$user_c",user_c)
|
76 |
html_body=""
|
77 |
for user,bot in chat:
|
78 |
html_body += html_user.replace("$chat",user)
|
|
|
82 |
filename=f'{make_filename(chat[0][0])}.png'
|
83 |
print(filename)
|
84 |
hti.screenshot(html_str=html, css_str=css_in, save_as=filename)
|
85 |
+
return filename,html,css
|
86 |
|
87 |
|
88 |
def format_prompt(message, history):
|