Spaces:
Sleeping
Sleeping
added chroma and assests
Browse files- app_modules/__pycache__/presets.cpython-310.pyc +0 -0
- app_modules/presets.py +83 -0
- assets/custom.css +192 -0
- chroma/chroma-collections.parquet +3 -0
- chroma/chroma-embeddings.parquet +3 -0
- chroma/index/id_to_uuid_320cffca-6981-46c3-b703-72c0d4684e89.pkl +3 -0
- chroma/index/index_320cffca-6981-46c3-b703-72c0d4684e89.bin +3 -0
- chroma/index/index_metadata_320cffca-6981-46c3-b703-72c0d4684e89.pkl +3 -0
- chroma/index/uuid_to_id_320cffca-6981-46c3-b703-72c0d4684e89.pkl +3 -0
app_modules/__pycache__/presets.cpython-310.pyc
ADDED
Binary file (2.47 kB). View file
|
|
app_modules/presets.py
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding:utf-8 -*-
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
|
5 |
+
title = """<h1 align="left" style="min-width:200px; margin-top:0;"> <img src="https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f432.svg" width="32px" style="display: inline"> Chat with Baize </h1>"""
|
6 |
+
description_top = """\
|
7 |
+
<div align="left">
|
8 |
+
<p> Currently Running: <a href="https://huggingface.co/project-baize/baize-v2-7b">baize-v2-7b</a></p>
|
9 |
+
<p>
|
10 |
+
Disclaimer: The LLaMA model is a third-party version available on Hugging Face model hub. This demo should be used for research purposes only. Commercial use is strictly prohibited. The model output is not censored and the authors do not endorse the opinions in the generated content. Use at your own risk.
|
11 |
+
</p >
|
12 |
+
</div>
|
13 |
+
"""
|
14 |
+
description = """\
|
15 |
+
<div align="center" style="margin:16px 0">
|
16 |
+
The demo is built on <a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT">ChuanhuChatGPT</a>.
|
17 |
+
</div>
|
18 |
+
"""
|
19 |
+
CONCURRENT_COUNT = 100
|
20 |
+
|
21 |
+
|
22 |
+
ALREADY_CONVERTED_MARK = "<!-- ALREADY CONVERTED BY PARSER. -->"
|
23 |
+
|
24 |
+
small_and_beautiful_theme = gr.themes.Soft(
|
25 |
+
primary_hue=gr.themes.Color(
|
26 |
+
c50="#02C160",
|
27 |
+
c100="rgba(2, 193, 96, 0.2)",
|
28 |
+
c200="#02C160",
|
29 |
+
c300="rgba(2, 193, 96, 0.32)",
|
30 |
+
c400="rgba(2, 193, 96, 0.32)",
|
31 |
+
c500="rgba(2, 193, 96, 1.0)",
|
32 |
+
c600="rgba(2, 193, 96, 1.0)",
|
33 |
+
c700="rgba(2, 193, 96, 0.32)",
|
34 |
+
c800="rgba(2, 193, 96, 0.32)",
|
35 |
+
c900="#02C160",
|
36 |
+
c950="#02C160",
|
37 |
+
),
|
38 |
+
secondary_hue=gr.themes.Color(
|
39 |
+
c50="#576b95",
|
40 |
+
c100="#576b95",
|
41 |
+
c200="#576b95",
|
42 |
+
c300="#576b95",
|
43 |
+
c400="#576b95",
|
44 |
+
c500="#576b95",
|
45 |
+
c600="#576b95",
|
46 |
+
c700="#576b95",
|
47 |
+
c800="#576b95",
|
48 |
+
c900="#576b95",
|
49 |
+
c950="#576b95",
|
50 |
+
),
|
51 |
+
neutral_hue=gr.themes.Color(
|
52 |
+
name="gray",
|
53 |
+
c50="#f9fafb",
|
54 |
+
c100="#f3f4f6",
|
55 |
+
c200="#e5e7eb",
|
56 |
+
c300="#d1d5db",
|
57 |
+
c400="#B2B2B2",
|
58 |
+
c500="#808080",
|
59 |
+
c600="#636363",
|
60 |
+
c700="#515151",
|
61 |
+
c800="#393939",
|
62 |
+
c900="#272727",
|
63 |
+
c950="#171717",
|
64 |
+
),
|
65 |
+
radius_size=gr.themes.sizes.radius_sm,
|
66 |
+
).set(
|
67 |
+
button_primary_background_fill="#06AE56",
|
68 |
+
button_primary_background_fill_dark="#06AE56",
|
69 |
+
button_primary_background_fill_hover="#07C863",
|
70 |
+
button_primary_border_color="#06AE56",
|
71 |
+
button_primary_border_color_dark="#06AE56",
|
72 |
+
button_primary_text_color="#FFFFFF",
|
73 |
+
button_primary_text_color_dark="#FFFFFF",
|
74 |
+
button_secondary_background_fill="#F2F2F2",
|
75 |
+
button_secondary_background_fill_dark="#2B2B2B",
|
76 |
+
button_secondary_text_color="#393939",
|
77 |
+
button_secondary_text_color_dark="#FFFFFF",
|
78 |
+
# background_fill_primary="#F7F7F7",
|
79 |
+
# background_fill_primary_dark="#1F1F1F",
|
80 |
+
block_title_text_color="*primary_500",
|
81 |
+
block_title_background_fill="*primary_100",
|
82 |
+
input_background_fill="#F6F6F6",
|
83 |
+
)
|
assets/custom.css
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
:root {
|
2 |
+
--chatbot-color-light: #F3F3F3;
|
3 |
+
--chatbot-color-dark: #121111;
|
4 |
+
}
|
5 |
+
|
6 |
+
|
7 |
+
/* status_display */
|
8 |
+
#status_display {
|
9 |
+
display: flex;
|
10 |
+
min-height: 2.5em;
|
11 |
+
align-items: flex-end;
|
12 |
+
justify-content: flex-end;
|
13 |
+
}
|
14 |
+
#status_display p {
|
15 |
+
font-size: .85em;
|
16 |
+
font-family: monospace;
|
17 |
+
color: var(--body-text-color-subdued);
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
/* usage_display */
|
23 |
+
#usage_display {
|
24 |
+
height: 1em;
|
25 |
+
}
|
26 |
+
#usage_display p{
|
27 |
+
padding: 0 1em;
|
28 |
+
font-size: .85em;
|
29 |
+
font-family: monospace;
|
30 |
+
color: var(--body-text-color-subdued);
|
31 |
+
}
|
32 |
+
/* list */
|
33 |
+
ol:not(.options), ul:not(.options) {
|
34 |
+
padding-inline-start: 2em !important;
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Thank @Keldos-Li for fixing it */
|
38 |
+
/* Light mode (default) */
|
39 |
+
#chuanhu_chatbot {
|
40 |
+
background-color: var(--chatbot-color-light) !important;
|
41 |
+
color: #000000 !important;
|
42 |
+
}
|
43 |
+
[data-testid = "bot"] {
|
44 |
+
background-color: #FFFFFF !important;
|
45 |
+
}
|
46 |
+
[data-testid = "user"] {
|
47 |
+
background-color: #95EC69 !important;
|
48 |
+
}
|
49 |
+
|
50 |
+
/* Dark mode */
|
51 |
+
.dark #chuanhu_chatbot {
|
52 |
+
background-color: var(--chatbot-color-dark) !important;
|
53 |
+
color: #FFFFFF !important;
|
54 |
+
}
|
55 |
+
.dark [data-testid = "bot"] {
|
56 |
+
background-color: #2C2C2C !important;
|
57 |
+
}
|
58 |
+
.dark [data-testid = "user"] {
|
59 |
+
background-color: #26B561 !important;
|
60 |
+
}
|
61 |
+
|
62 |
+
#chuanhu_chatbot {
|
63 |
+
height: 100%;
|
64 |
+
min-height: 400px;
|
65 |
+
}
|
66 |
+
|
67 |
+
[class *= "message"] {
|
68 |
+
border-radius: var(--radius-xl) !important;
|
69 |
+
border: none;
|
70 |
+
padding: var(--spacing-xl) !important;
|
71 |
+
font-size: var(--text-md) !important;
|
72 |
+
line-height: var(--line-md) !important;
|
73 |
+
min-height: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl));
|
74 |
+
min-width: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl));
|
75 |
+
}
|
76 |
+
[data-testid = "bot"] {
|
77 |
+
max-width: 85%;
|
78 |
+
border-bottom-left-radius: 0 !important;
|
79 |
+
}
|
80 |
+
[data-testid = "user"] {
|
81 |
+
max-width: 85%;
|
82 |
+
width: auto !important;
|
83 |
+
border-bottom-right-radius: 0 !important;
|
84 |
+
}
|
85 |
+
/* Table */
|
86 |
+
table {
|
87 |
+
margin: 1em 0;
|
88 |
+
border-collapse: collapse;
|
89 |
+
empty-cells: show;
|
90 |
+
}
|
91 |
+
td,th {
|
92 |
+
border: 1.2px solid var(--border-color-primary) !important;
|
93 |
+
padding: 0.2em;
|
94 |
+
}
|
95 |
+
thead {
|
96 |
+
background-color: rgba(175,184,193,0.2);
|
97 |
+
}
|
98 |
+
thead th {
|
99 |
+
padding: .5em .2em;
|
100 |
+
}
|
101 |
+
/* Inline code */
|
102 |
+
#chuanhu_chatbot code {
|
103 |
+
display: inline;
|
104 |
+
white-space: break-spaces;
|
105 |
+
border-radius: 6px;
|
106 |
+
margin: 0 2px 0 2px;
|
107 |
+
padding: .2em .4em .1em .4em;
|
108 |
+
background-color: rgba(175,184,193,0.2);
|
109 |
+
}
|
110 |
+
/* Code block */
|
111 |
+
#chuanhu_chatbot pre code {
|
112 |
+
display: block;
|
113 |
+
overflow: auto;
|
114 |
+
white-space: pre;
|
115 |
+
background-color: hsla(0, 0%, 0%, 80%)!important;
|
116 |
+
border-radius: 10px;
|
117 |
+
padding: 1.4em 1.2em 0em 1.4em;
|
118 |
+
margin: 1.2em 2em 1.2em 0.5em;
|
119 |
+
color: #FFF;
|
120 |
+
box-shadow: 6px 6px 16px hsla(0, 0%, 0%, 0.2);
|
121 |
+
}
|
122 |
+
/* Hightlight */
|
123 |
+
#chuanhu_chatbot .highlight { background-color: transparent }
|
124 |
+
#chuanhu_chatbot .highlight .hll { background-color: #49483e }
|
125 |
+
#chuanhu_chatbot .highlight .c { color: #75715e } /* Comment */
|
126 |
+
#chuanhu_chatbot .highlight .err { color: #960050; background-color: #1e0010 } /* Error */
|
127 |
+
#chuanhu_chatbot .highlight .k { color: #66d9ef } /* Keyword */
|
128 |
+
#chuanhu_chatbot .highlight .l { color: #ae81ff } /* Literal */
|
129 |
+
#chuanhu_chatbot .highlight .n { color: #f8f8f2 } /* Name */
|
130 |
+
#chuanhu_chatbot .highlight .o { color: #f92672 } /* Operator */
|
131 |
+
#chuanhu_chatbot .highlight .p { color: #f8f8f2 } /* Punctuation */
|
132 |
+
#chuanhu_chatbot .highlight .ch { color: #75715e } /* Comment.Hashbang */
|
133 |
+
#chuanhu_chatbot .highlight .cm { color: #75715e } /* Comment.Multiline */
|
134 |
+
#chuanhu_chatbot .highlight .cp { color: #75715e } /* Comment.Preproc */
|
135 |
+
#chuanhu_chatbot .highlight .cpf { color: #75715e } /* Comment.PreprocFile */
|
136 |
+
#chuanhu_chatbot .highlight .c1 { color: #75715e } /* Comment.Single */
|
137 |
+
#chuanhu_chatbot .highlight .cs { color: #75715e } /* Comment.Special */
|
138 |
+
#chuanhu_chatbot .highlight .gd { color: #f92672 } /* Generic.Deleted */
|
139 |
+
#chuanhu_chatbot .highlight .ge { font-style: italic } /* Generic.Emph */
|
140 |
+
#chuanhu_chatbot .highlight .gi { color: #a6e22e } /* Generic.Inserted */
|
141 |
+
#chuanhu_chatbot .highlight .gs { font-weight: bold } /* Generic.Strong */
|
142 |
+
#chuanhu_chatbot .highlight .gu { color: #75715e } /* Generic.Subheading */
|
143 |
+
#chuanhu_chatbot .highlight .kc { color: #66d9ef } /* Keyword.Constant */
|
144 |
+
#chuanhu_chatbot .highlight .kd { color: #66d9ef } /* Keyword.Declaration */
|
145 |
+
#chuanhu_chatbot .highlight .kn { color: #f92672 } /* Keyword.Namespace */
|
146 |
+
#chuanhu_chatbot .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
|
147 |
+
#chuanhu_chatbot .highlight .kr { color: #66d9ef } /* Keyword.Reserved */
|
148 |
+
#chuanhu_chatbot .highlight .kt { color: #66d9ef } /* Keyword.Type */
|
149 |
+
#chuanhu_chatbot .highlight .ld { color: #e6db74 } /* Literal.Date */
|
150 |
+
#chuanhu_chatbot .highlight .m { color: #ae81ff } /* Literal.Number */
|
151 |
+
#chuanhu_chatbot .highlight .s { color: #e6db74 } /* Literal.String */
|
152 |
+
#chuanhu_chatbot .highlight .na { color: #a6e22e } /* Name.Attribute */
|
153 |
+
#chuanhu_chatbot .highlight .nb { color: #f8f8f2 } /* Name.Builtin */
|
154 |
+
#chuanhu_chatbot .highlight .nc { color: #a6e22e } /* Name.Class */
|
155 |
+
#chuanhu_chatbot .highlight .no { color: #66d9ef } /* Name.Constant */
|
156 |
+
#chuanhu_chatbot .highlight .nd { color: #a6e22e } /* Name.Decorator */
|
157 |
+
#chuanhu_chatbot .highlight .ni { color: #f8f8f2 } /* Name.Entity */
|
158 |
+
#chuanhu_chatbot .highlight .ne { color: #a6e22e } /* Name.Exception */
|
159 |
+
#chuanhu_chatbot .highlight .nf { color: #a6e22e } /* Name.Function */
|
160 |
+
#chuanhu_chatbot .highlight .nl { color: #f8f8f2 } /* Name.Label */
|
161 |
+
#chuanhu_chatbot .highlight .nn { color: #f8f8f2 } /* Name.Namespace */
|
162 |
+
#chuanhu_chatbot .highlight .nx { color: #a6e22e } /* Name.Other */
|
163 |
+
#chuanhu_chatbot .highlight .py { color: #f8f8f2 } /* Name.Property */
|
164 |
+
#chuanhu_chatbot .highlight .nt { color: #f92672 } /* Name.Tag */
|
165 |
+
#chuanhu_chatbot .highlight .nv { color: #f8f8f2 } /* Name.Variable */
|
166 |
+
#chuanhu_chatbot .highlight .ow { color: #f92672 } /* Operator.Word */
|
167 |
+
#chuanhu_chatbot .highlight .w { color: #f8f8f2 } /* Text.Whitespace */
|
168 |
+
#chuanhu_chatbot .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
|
169 |
+
#chuanhu_chatbot .highlight .mf { color: #ae81ff } /* Literal.Number.Float */
|
170 |
+
#chuanhu_chatbot .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
|
171 |
+
#chuanhu_chatbot .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
|
172 |
+
#chuanhu_chatbot .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
|
173 |
+
#chuanhu_chatbot .highlight .sa { color: #e6db74 } /* Literal.String.Affix */
|
174 |
+
#chuanhu_chatbot .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
|
175 |
+
#chuanhu_chatbot .highlight .sc { color: #e6db74 } /* Literal.String.Char */
|
176 |
+
#chuanhu_chatbot .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
|
177 |
+
#chuanhu_chatbot .highlight .sd { color: #e6db74 } /* Literal.String.Doc */
|
178 |
+
#chuanhu_chatbot .highlight .s2 { color: #e6db74 } /* Literal.String.Double */
|
179 |
+
#chuanhu_chatbot .highlight .se { color: #ae81ff } /* Literal.String.Escape */
|
180 |
+
#chuanhu_chatbot .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
|
181 |
+
#chuanhu_chatbot .highlight .si { color: #e6db74 } /* Literal.String.Interpol */
|
182 |
+
#chuanhu_chatbot .highlight .sx { color: #e6db74 } /* Literal.String.Other */
|
183 |
+
#chuanhu_chatbot .highlight .sr { color: #e6db74 } /* Literal.String.Regex */
|
184 |
+
#chuanhu_chatbot .highlight .s1 { color: #e6db74 } /* Literal.String.Single */
|
185 |
+
#chuanhu_chatbot .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
|
186 |
+
#chuanhu_chatbot .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
|
187 |
+
#chuanhu_chatbot .highlight .fm { color: #a6e22e } /* Name.Function.Magic */
|
188 |
+
#chuanhu_chatbot .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
|
189 |
+
#chuanhu_chatbot .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
|
190 |
+
#chuanhu_chatbot .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
|
191 |
+
#chuanhu_chatbot .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
|
192 |
+
#chuanhu_chatbot .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
|
chroma/chroma-collections.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d7228380c42871e39b171eac35ab9b0a90c15fd30819ceaeb724295ac0a6c4a3
|
3 |
+
size 557
|
chroma/chroma-embeddings.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:51a80b6e866058ffa4ba11cb462f3791218919b2eecbbf5645dd3e31f03bcc53
|
3 |
+
size 65714288
|
chroma/index/id_to_uuid_320cffca-6981-46c3-b703-72c0d4684e89.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8a5ecc051c898ee8360beecc109fb57716ec0482af72c8fc87e9d9d2550e1c97
|
3 |
+
size 169878
|
chroma/index/index_320cffca-6981-46c3-b703-72c0d4684e89.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80e0bb413aff50c58d6be3120fc2c0adc20d49aa958c49bbb8abec4d26beb6f4
|
3 |
+
size 32942120
|
chroma/index/index_metadata_320cffca-6981-46c3-b703-72c0d4684e89.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4991895440d178613fbcec75b32fcb54ecc179a40674d3e4cfd53653fde4843a
|
3 |
+
size 105
|
chroma/index/uuid_to_id_320cffca-6981-46c3-b703-72c0d4684e89.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2dd348b0ae8651631d7e42489b386f07115738a77cc88c17caff13cd591b6ab0
|
3 |
+
size 198728
|