Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -25,6 +25,22 @@ model_path = hf_hub_download(
|
|
25 |
|
26 |
print(f"Downloaded model path: {model_path}")
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
css = """
|
29 |
.bubble-wrap {
|
30 |
padding-top: calc(var(--spacing-xl) * 3) !important;
|
@@ -38,21 +54,28 @@ css = """
|
|
38 |
}
|
39 |
.flex-wrap.user {
|
40 |
border-bottom-right-radius: var(--radius-lg) !important;
|
|
|
|
|
41 |
}
|
42 |
.flex-wrap.bot {
|
43 |
border-bottom-left-radius: var(--radius-lg) !important;
|
|
|
|
|
44 |
}
|
45 |
.message.user{
|
46 |
padding: 10px;
|
|
|
47 |
}
|
48 |
.message.bot{
|
49 |
text-align: right;
|
50 |
width: 100%;
|
51 |
padding: 10px;
|
52 |
border-radius: 10px;
|
|
|
53 |
}
|
54 |
.message-bubble-border {
|
55 |
-
border-radius:
|
|
|
56 |
}
|
57 |
.message-buttons {
|
58 |
justify-content: flex-end !important;
|
@@ -66,16 +89,163 @@ css = """
|
|
66 |
bottom: 2px !important;
|
67 |
}
|
68 |
.dark.message-bubble-border {
|
69 |
-
border-color: #
|
|
|
70 |
}
|
71 |
.dark.user {
|
72 |
-
background: #
|
|
|
73 |
}
|
74 |
.dark.assistant.dark, .dark.pending.dark {
|
75 |
-
background: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
"""
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
def get_messages_formatter_type(model_name):
|
80 |
if "Mistral" in model_name or "BitSix" in model_name:
|
81 |
return MessagesFormatterType.CHATML # Mistral κ³μ΄ λͺ¨λΈμ ChatML νμ μ¬μ©
|
@@ -161,22 +331,23 @@ def respond(
|
|
161 |
outputs += output
|
162 |
yield outputs
|
163 |
|
|
|
164 |
PLACEHOLDER = """
|
165 |
-
<div class="message-bubble-border" style="display:flex; max-width: 600px; border-radius:
|
166 |
<figure style="margin: 0;max-width: 200px;min-height: 300px;">
|
167 |
-
<img src="
|
168 |
</figure>
|
169 |
-
<div style="padding:
|
170 |
-
<h2 style="text-align: left; font-size: 1.
|
171 |
-
<p style="text-align: left; font-size: 16px; line-height: 1.
|
172 |
<div style="display: flex; justify-content: space-between; align-items: center;">
|
173 |
<div style="display: flex; flex-flow: column; justify-content: space-between;">
|
174 |
-
<span style="display: inline-flex; align-items: center; border-radius: 0.
|
175 |
Private BitSix Mistral Small 3.1 24B Instruct
|
176 |
</span>
|
177 |
</div>
|
178 |
<div style="display: flex; justify-content: flex-end; align-items: center;">
|
179 |
-
<a href="https://discord.gg/openfreeai" target="_blank" rel="noreferrer" style="padding: .5rem;">
|
180 |
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 5 30.67 23.25">
|
181 |
<title>Discord</title>
|
182 |
<path d="M26.0015 6.9529C24.0021 6.03845 21.8787 5.37198 19.6623 5C19.3833 5.48048 19.0733 6.13144 18.8563 6.64292C16.4989 6.30193 14.1585 6.30193 11.8336 6.64292C11.6166 6.13144 11.2911 5.48048 11.0276 5C8.79575 5.37198 6.67235 6.03845 4.6869 6.9529C0.672601 12.8736 -0.41235 18.6548 0.130124 24.3585C2.79599 26.2959 5.36889 27.4739 7.89682 28.2489C8.51679 27.4119 9.07477 26.5129 9.55525 25.5675C8.64079 25.2265 7.77283 24.808 6.93587 24.312C7.15286 24.1571 7.36986 23.9866 7.57135 23.8161C12.6241 26.1255 18.0969 26.1255 23.0876 23.8161C23.3046 23.9866 23.5061 24.1571 23.7231 24.312C22.8861 24.808 22.0182 25.2265 21.1037 25.5675C21.5842 26.5129 22.1422 27.4119 22.7621 28.2489C25.2885 27.4739 27.8769 26.2959 30.5288 24.3585C31.1952 17.7559 29.4733 12.0212 26.0015 6.9529ZM10.2527 20.8402C8.73376 20.8402 7.49382 19.4608 7.49382 17.7714C7.49382 16.082 8.70276 14.7025 10.2527 14.7025C11.7871 14.7025 13.0425 16.082 13.0115 17.7714C13.0115 19.4608 11.7871 20.8402 10.2527 20.8402ZM20.4373 20.8402C18.9183 20.8402 17.6768 19.4608 17.6768 17.7714C17.6768 16.082 18.8873 14.7025 20.4373 14.7025C21.9717 14.7025 23.2271 16.082 23.1961 17.7714C23.1961 19.4608 21.9872 20.8402 20.4373 20.8402Z"></path>
|
@@ -188,43 +359,81 @@ PLACEHOLDER = """
|
|
188 |
</div>
|
189 |
"""
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
)
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
if __name__ == "__main__":
|
230 |
demo.launch()
|
|
|
25 |
|
26 |
print(f"Downloaded model path: {model_path}")
|
27 |
|
28 |
+
# νμ€ν
ν€ μμ μ μ
|
29 |
+
PASTEL_COLORS = {
|
30 |
+
"background": "#f9f7ff",
|
31 |
+
"primary": "#d8b4fe",
|
32 |
+
"secondary": "#e9d5ff",
|
33 |
+
"accent": "#c084fc",
|
34 |
+
"text": "#4c1d95",
|
35 |
+
"border": "#ddd6fe",
|
36 |
+
"dark_bg": "#1e1a2e",
|
37 |
+
"dark_primary": "#9d74d9",
|
38 |
+
"dark_secondary": "#7c58b9",
|
39 |
+
"dark_accent": "#8b5cf6",
|
40 |
+
"dark_text": "#e9d5ff",
|
41 |
+
"dark_border": "#5b21b6"
|
42 |
+
}
|
43 |
+
|
44 |
css = """
|
45 |
.bubble-wrap {
|
46 |
padding-top: calc(var(--spacing-xl) * 3) !important;
|
|
|
54 |
}
|
55 |
.flex-wrap.user {
|
56 |
border-bottom-right-radius: var(--radius-lg) !important;
|
57 |
+
background: #f3e8ff !important;
|
58 |
+
border: 1px solid #ddd6fe !important;
|
59 |
}
|
60 |
.flex-wrap.bot {
|
61 |
border-bottom-left-radius: var(--radius-lg) !important;
|
62 |
+
background: #ede9fe !important;
|
63 |
+
border: 1px solid #ddd6fe !important;
|
64 |
}
|
65 |
.message.user{
|
66 |
padding: 10px;
|
67 |
+
color: #5b21b6;
|
68 |
}
|
69 |
.message.bot{
|
70 |
text-align: right;
|
71 |
width: 100%;
|
72 |
padding: 10px;
|
73 |
border-radius: 10px;
|
74 |
+
color: #6d28d9;
|
75 |
}
|
76 |
.message-bubble-border {
|
77 |
+
border-radius: 12px !important;
|
78 |
+
box-shadow: 0 2px 10px rgba(186, 162, 255, 0.2) !important;
|
79 |
}
|
80 |
.message-buttons {
|
81 |
justify-content: flex-end !important;
|
|
|
89 |
bottom: 2px !important;
|
90 |
}
|
91 |
.dark.message-bubble-border {
|
92 |
+
border-color: #5b21b6 !important;
|
93 |
+
box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3) !important;
|
94 |
}
|
95 |
.dark.user {
|
96 |
+
background: #2e1065 !important;
|
97 |
+
border: 1px solid #5b21b6 !important;
|
98 |
}
|
99 |
.dark.assistant.dark, .dark.pending.dark {
|
100 |
+
background: #27104a !important;
|
101 |
+
border: 1px solid #5b21b6 !important;
|
102 |
+
}
|
103 |
+
|
104 |
+
/* 컀μ€ν
μ€νμΌ μΆκ° */
|
105 |
+
.gradio-container {
|
106 |
+
background-color: #f5f3ff !important;
|
107 |
+
}
|
108 |
+
.dark .gradio-container {
|
109 |
+
background-color: #1e1a2e !important;
|
110 |
+
}
|
111 |
+
.gr-button-primary {
|
112 |
+
background-color: #a78bfa !important;
|
113 |
+
border: 1px solid #8b5cf6 !important;
|
114 |
+
}
|
115 |
+
.dark .gr-button-primary {
|
116 |
+
background-color: #7c3aed !important;
|
117 |
+
border: 1px solid #6d28d9 !important;
|
118 |
+
}
|
119 |
+
.gr-input, .gr-textarea {
|
120 |
+
border: 1px solid #ddd6fe !important;
|
121 |
+
background-color: #faf5ff !important;
|
122 |
+
}
|
123 |
+
.dark .gr-input, .dark .gr-textarea {
|
124 |
+
border: 1px solid #5b21b6 !important;
|
125 |
+
background-color: #27104a !important;
|
126 |
+
color: #e9d5ff !important;
|
127 |
+
}
|
128 |
+
.gr-padded {
|
129 |
+
border-radius: 12px !important;
|
130 |
+
}
|
131 |
+
.gr-box {
|
132 |
+
border-radius: 12px !important;
|
133 |
+
border: 1px solid #ddd6fe !important;
|
134 |
+
box-shadow: 0 4px 12px rgba(186, 162, 255, 0.15) !important;
|
135 |
+
}
|
136 |
+
.dark .gr-box {
|
137 |
+
border: 1px solid #5b21b6 !important;
|
138 |
+
box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2) !important;
|
139 |
+
}
|
140 |
+
|
141 |
+
/* λͺ¨λ¬ μ€νμΌ */
|
142 |
+
.modal-overlay {
|
143 |
+
position: fixed;
|
144 |
+
top: 0;
|
145 |
+
left: 0;
|
146 |
+
width: 100%;
|
147 |
+
height: 100%;
|
148 |
+
background-color: rgba(0, 0, 0, 0.5);
|
149 |
+
display: flex;
|
150 |
+
justify-content: center;
|
151 |
+
align-items: center;
|
152 |
+
z-index: 1000;
|
153 |
+
opacity: 0;
|
154 |
+
transition: opacity 0.3s ease;
|
155 |
+
}
|
156 |
+
.modal-content {
|
157 |
+
background-color: #f5f3ff;
|
158 |
+
border-radius: 16px;
|
159 |
+
padding: 20px;
|
160 |
+
box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
|
161 |
+
text-align: center;
|
162 |
+
max-width: 400px;
|
163 |
+
width: 100%;
|
164 |
+
transform: scale(0.8);
|
165 |
+
transition: transform 0.3s ease;
|
166 |
+
}
|
167 |
+
.dark .modal-content {
|
168 |
+
background-color: #1e1a2e;
|
169 |
+
box-shadow: 0 10px 25px rgba(109, 40, 217, 0.4);
|
170 |
+
}
|
171 |
+
.modal-header {
|
172 |
+
margin-bottom: 15px;
|
173 |
+
color: #6d28d9;
|
174 |
+
font-size: 20px;
|
175 |
+
font-weight: bold;
|
176 |
+
}
|
177 |
+
.dark .modal-header {
|
178 |
+
color: #a78bfa;
|
179 |
+
}
|
180 |
+
.modal-img {
|
181 |
+
width: 200px;
|
182 |
+
height: 200px;
|
183 |
+
object-fit: contain;
|
184 |
+
border-radius: 8px;
|
185 |
+
margin-bottom: 15px;
|
186 |
+
border: 3px solid #c4b5fd;
|
187 |
+
}
|
188 |
+
.dark .modal-img {
|
189 |
+
border-color: #7c3aed;
|
190 |
+
}
|
191 |
+
.modal-close {
|
192 |
+
background-color: #a78bfa;
|
193 |
+
color: white;
|
194 |
+
border: none;
|
195 |
+
padding: 8px 15px;
|
196 |
+
border-radius: 8px;
|
197 |
+
cursor: pointer;
|
198 |
+
font-weight: bold;
|
199 |
+
margin-top: 10px;
|
200 |
+
transition: background-color 0.2s;
|
201 |
+
}
|
202 |
+
.modal-close:hover {
|
203 |
+
background-color: #8b5cf6;
|
204 |
+
}
|
205 |
+
.dark .modal-close {
|
206 |
+
background-color: #7c3aed;
|
207 |
+
}
|
208 |
+
.dark .modal-close:hover {
|
209 |
+
background-color: #6d28d9;
|
210 |
+
}
|
211 |
+
.show-modal {
|
212 |
+
opacity: 1;
|
213 |
+
}
|
214 |
+
.show-modal .modal-content {
|
215 |
+
transform: scale(1);
|
216 |
}
|
217 |
"""
|
218 |
|
219 |
+
# HTML μ½λ μΆκ° - μ΄λ―Έμ§ νμ
λͺ¨λ¬
|
220 |
+
welcome_modal_html = """
|
221 |
+
<div id="welcomeModal" class="modal-overlay">
|
222 |
+
<div class="modal-content">
|
223 |
+
<div class="modal-header">Private-BitSix AIμ μ€μ κ²μ νμν©λλ€</div>
|
224 |
+
<img src="file/llama.jpg" alt="Llama Logo" class="modal-img">
|
225 |
+
<p style="margin-bottom: 15px; color: #6d28d9;">6BIT μμνλ‘ λͺ¨λΈ ν¬κΈ°λ μ€μ΄κ³ μ±λ₯μ μ μ§νλ νλΌμ΄λ²μ μ€μ¬ AI μ루μ
.</p>
|
226 |
+
<button id="closeModal" class="modal-close">μμνκΈ°</button>
|
227 |
+
</div>
|
228 |
+
</div>
|
229 |
+
|
230 |
+
<script>
|
231 |
+
// νμ΄μ§ λ‘λ ν λͺ¨λ¬ νμ
|
232 |
+
document.addEventListener('DOMContentLoaded', function() {
|
233 |
+
setTimeout(function() {
|
234 |
+
var modal = document.getElementById('welcomeModal');
|
235 |
+
modal.classList.add('show-modal');
|
236 |
+
|
237 |
+
// λ«κΈ° λ²νΌ ν΄λ¦ μ λͺ¨λ¬ λ«κΈ°
|
238 |
+
document.getElementById('closeModal').addEventListener('click', function() {
|
239 |
+
modal.classList.remove('show-modal');
|
240 |
+
setTimeout(function() {
|
241 |
+
modal.style.display = 'none';
|
242 |
+
}, 300);
|
243 |
+
});
|
244 |
+
}, 500);
|
245 |
+
});
|
246 |
+
</script>
|
247 |
+
"""
|
248 |
+
|
249 |
def get_messages_formatter_type(model_name):
|
250 |
if "Mistral" in model_name or "BitSix" in model_name:
|
251 |
return MessagesFormatterType.CHATML # Mistral κ³μ΄ λͺ¨λΈμ ChatML νμ μ¬μ©
|
|
|
331 |
outputs += output
|
332 |
yield outputs
|
333 |
|
334 |
+
# νμ€ν
ν€ ν
λ§λ‘ μ
λ°μ΄νΈλ νλ μ΄μ€νλ
|
335 |
PLACEHOLDER = """
|
336 |
+
<div class="message-bubble-border" style="display:flex; max-width: 600px; border-radius: 16px; border-width: 1px; border-color: #ddd6fe; box-shadow: 0 4px 12px rgba(186, 162, 255, 0.2); backdrop-filter: blur(10px);">
|
337 |
<figure style="margin: 0;max-width: 200px;min-height: 300px;">
|
338 |
+
<img src="file/llama.jpg" alt="Logo" style="width: 100%; height: 100%; border-radius: 12px; border: 3px solid #c4b5fd;">
|
339 |
</figure>
|
340 |
+
<div style="padding: 1rem 1.5rem;display: flex;flex-direction: column;justify-content: space-evenly;">
|
341 |
+
<h2 style="text-align: left; font-size: 1.8rem; font-weight: 700; margin-bottom: 0.8rem; color: #6d28d9;">Ginigen Private-BitSix</h2>
|
342 |
+
<p style="text-align: left; font-size: 16px; line-height: 1.6; margin-bottom: 15px; color: #7c3aed;">The Ginigen Private-BitSix framework simplifies interactions with Large Language Models (LLMs), providing an interface for chatting, executing function calls, generating structured output, performing retrieval augmented generation, and processing text using agentic chains with tools.</p>
|
343 |
<div style="display: flex; justify-content: space-between; align-items: center;">
|
344 |
<div style="display: flex; flex-flow: column; justify-content: space-between;">
|
345 |
+
<span style="display: inline-flex; align-items: center; border-radius: 0.5rem; background-color: rgba(192, 132, 252, 0.2); padding: 0.2rem 0.75rem; font-size: 0.8rem; font-weight: 500; color: #8b5cf6; margin-bottom: 5px; border: 1px solid #c4b5fd;">
|
346 |
Private BitSix Mistral Small 3.1 24B Instruct
|
347 |
</span>
|
348 |
</div>
|
349 |
<div style="display: flex; justify-content: flex-end; align-items: center;">
|
350 |
+
<a href="https://discord.gg/openfreeai" target="_blank" rel="noreferrer" style="padding: .5rem; color: #6d28d9;">
|
351 |
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 5 30.67 23.25">
|
352 |
<title>Discord</title>
|
353 |
<path d="M26.0015 6.9529C24.0021 6.03845 21.8787 5.37198 19.6623 5C19.3833 5.48048 19.0733 6.13144 18.8563 6.64292C16.4989 6.30193 14.1585 6.30193 11.8336 6.64292C11.6166 6.13144 11.2911 5.48048 11.0276 5C8.79575 5.37198 6.67235 6.03845 4.6869 6.9529C0.672601 12.8736 -0.41235 18.6548 0.130124 24.3585C2.79599 26.2959 5.36889 27.4739 7.89682 28.2489C8.51679 27.4119 9.07477 26.5129 9.55525 25.5675C8.64079 25.2265 7.77283 24.808 6.93587 24.312C7.15286 24.1571 7.36986 23.9866 7.57135 23.8161C12.6241 26.1255 18.0969 26.1255 23.0876 23.8161C23.3046 23.9866 23.5061 24.1571 23.7231 24.312C22.8861 24.808 22.0182 25.2265 21.1037 25.5675C21.5842 26.5129 22.1422 27.4119 22.7621 28.2489C25.2885 27.4739 27.8769 26.2959 30.5288 24.3585C31.1952 17.7559 29.4733 12.0212 26.0015 6.9529ZM10.2527 20.8402C8.73376 20.8402 7.49382 19.4608 7.49382 17.7714C7.49382 16.082 8.70276 14.7025 10.2527 14.7025C11.7871 14.7025 13.0425 16.082 13.0115 17.7714C13.0115 19.4608 11.7871 20.8402 10.2527 20.8402ZM20.4373 20.8402C18.9183 20.8402 17.6768 19.4608 17.6768 17.7714C17.6768 16.082 18.8873 14.7025 20.4373 14.7025C21.9717 14.7025 23.2271 16.082 23.1961 17.7714C23.1961 19.4608 21.9872 20.8402 20.4373 20.8402Z"></path>
|
|
|
359 |
</div>
|
360 |
"""
|
361 |
|
362 |
+
# νμ€ν
ν€ ν
λ§ μ€μ
|
363 |
+
pastel_theme = gr.themes.Soft(
|
364 |
+
primary_hue=gr.themes.colors.purple,
|
365 |
+
secondary_hue=gr.themes.colors.violet,
|
366 |
+
neutral_hue=gr.themes.colors.gray,
|
367 |
+
font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]
|
368 |
+
).set(
|
369 |
+
body_background_fill="#f5f3ff",
|
370 |
+
body_background_fill_dark="#1e1a2e",
|
371 |
+
block_background_fill="#f8f4ff",
|
372 |
+
block_background_fill_dark="#27104a",
|
373 |
+
block_border_width="1px",
|
374 |
+
block_border_color="#ddd6fe",
|
375 |
+
block_border_color_dark="#5b21b6",
|
376 |
+
block_title_background_fill="#f3e8ff",
|
377 |
+
block_title_background_fill_dark="#2e1065",
|
378 |
+
block_title_text_color="#6d28d9",
|
379 |
+
block_title_text_color_dark="#c4b5fd",
|
380 |
+
block_label_background_fill="#faf5ff",
|
381 |
+
block_label_background_fill_dark="#1e1a2e",
|
382 |
+
block_label_text_color="#7c3aed",
|
383 |
+
block_label_text_color_dark="#a78bfa",
|
384 |
+
input_background_fill="#faf5ff",
|
385 |
+
input_background_fill_dark="#27104a",
|
386 |
+
input_border_color="#ddd6fe",
|
387 |
+
input_border_color_dark="#5b21b6",
|
388 |
+
input_border_width="1px",
|
389 |
+
button_primary_background_fill="#a78bfa",
|
390 |
+
button_primary_background_fill_dark="#7c3aed",
|
391 |
+
button_primary_text_color="white",
|
392 |
+
button_primary_text_color_dark="white",
|
393 |
+
button_secondary_background_fill="#f3e8ff",
|
394 |
+
button_secondary_background_fill_dark="#2e1065",
|
395 |
+
button_secondary_text_color="#6d28d9",
|
396 |
+
button_secondary_text_color_dark="#a78bfa",
|
397 |
+
border_color_accent="#c4b5fd",
|
398 |
+
border_color_accent_dark="#7c3aed",
|
399 |
+
border_color_primary="#ddd6fe",
|
400 |
+
border_color_primary_dark="#5b21b6",
|
401 |
+
background_fill_secondary="#f3e8ff",
|
402 |
+
background_fill_secondary_dark="#1e1a2e",
|
403 |
+
color_accent_soft="#ede9fe",
|
404 |
+
color_accent_soft_dark="#3b0764",
|
405 |
+
code_background_fill="#f3e8ff",
|
406 |
+
code_background_fill_dark="#2e1065",
|
407 |
)
|
408 |
|
409 |
+
with gr.Blocks(theme=pastel_theme, css=css) as demo:
|
410 |
+
# μ°μ»΄ λͺ¨λ¬ μΆκ°
|
411 |
+
gr.HTML(welcome_modal_html)
|
412 |
+
|
413 |
+
# μ±λ΄ μΈν°νμ΄μ€
|
414 |
+
gr.ChatInterface(
|
415 |
+
fn=respond,
|
416 |
+
title="Ginigen Private AI",
|
417 |
+
description="6BIT μμνλ‘ λͺ¨λΈ ν¬κΈ°λ μ€μ΄κ³ μ±λ₯μ μ μ§νλ νλΌμ΄λ²μ μ€μ¬ AI μ루μ
.",
|
418 |
+
examples=[
|
419 |
+
["μλ
νμΈμ, μ λ AIμ κ΄μ¬μ΄ λ§οΏ½οΏ½οΏ½λλ€. μμνλ 무μμΈκ°μ?"],
|
420 |
+
["λ―Έμ€νΈλ λͺ¨λΈμ νΉμ§μ 무μμΈκ°μ?"],
|
421 |
+
["κΈ΄ 컨ν
μ€νΈ(context)λ₯Ό μ²λ¦¬νλ λ°©λ²μ μ€λͺ
ν΄ μ£ΌμΈμ."]
|
422 |
+
],
|
423 |
+
additional_inputs=[
|
424 |
+
gr.Textbox(
|
425 |
+
value="You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside tags, and then provide your solution or response to the problem.",
|
426 |
+
label="μμ€ν
λ©μμ§",
|
427 |
+
lines=5
|
428 |
+
),
|
429 |
+
gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="μ΅λ ν ν° μ"),
|
430 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
431 |
+
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p"),
|
432 |
+
gr.Slider(minimum=0, maximum=100, value=40, step=1, label="Top-k"),
|
433 |
+
gr.Slider(minimum=0.0, maximum=2.0, value=1.1, step=0.1, label="Repetition penalty"),
|
434 |
+
],
|
435 |
+
chatbot=gr.Chatbot(placeholder=PLACEHOLDER, type="messages")
|
436 |
+
)
|
437 |
+
|
438 |
if __name__ == "__main__":
|
439 |
demo.launch()
|