replace app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
from src.distilabel_dataset_generator._tabbedinterface import TabbedInterface
|
4 |
+
from src.distilabel_dataset_generator.apps.faq import app as faq_app
|
5 |
+
from src.distilabel_dataset_generator.apps.sft import app as sft_app
|
6 |
+
from src.distilabel_dataset_generator.apps.textcat import app as textcat_app
|
7 |
+
|
8 |
+
theme ='argilla/argilla-theme'
|
9 |
+
|
10 |
+
css = """
|
11 |
+
.main_ui_logged_out{opacity: 0.3; pointer-events: none}
|
12 |
+
.tabitem{border: 0px}
|
13 |
+
.group_padding{padding: .55em}
|
14 |
+
#space_model .wrap > label:last-child{opacity: 0.3; pointer-events:none}
|
15 |
+
#system_prompt_examples {
|
16 |
+
color: black;
|
17 |
+
}
|
18 |
+
@media (prefers-color-scheme: dark) {
|
19 |
+
#system_prompt_examples {
|
20 |
+
color: white;
|
21 |
+
background-color: black;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
button[role="tab"].selected,
|
25 |
+
button[role="tab"][aria-selected="true"],
|
26 |
+
button[role="tab"][data-tab-id][aria-selected="true"] {
|
27 |
+
background-color: #000000;
|
28 |
+
color: white;
|
29 |
+
border: none;
|
30 |
+
font-size: 16px;
|
31 |
+
font-weight: bold;
|
32 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
33 |
+
transition: background-color 0.3s ease, color 0.3s ease;
|
34 |
+
}
|
35 |
+
.gallery {
|
36 |
+
color: black !important;
|
37 |
+
}
|
38 |
+
@media (prefers-color-scheme: dark) {
|
39 |
+
.gallery {
|
40 |
+
color: white !important;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
.flex-shrink-0.truncate.px-1 {
|
44 |
+
color: black !important;
|
45 |
+
}
|
46 |
+
@media (prefers-color-scheme: dark) {
|
47 |
+
.flex-shrink-0.truncate.px-1 {
|
48 |
+
color: white !important;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
"""
|
52 |
+
|
53 |
+
demo = TabbedInterface(
|
54 |
+
[textcat_app, sft_app, faq_app],
|
55 |
+
["Text Classification", "Supervised Fine-Tuning", "FAQ"],
|
56 |
+
css=css,
|
57 |
+
title="""
|
58 |
+
<h1>Synthetic Data Generator</h1>
|
59 |
+
<h3>Build datasets using natural language</h3>
|
60 |
+
""",
|
61 |
+
head="Synthetic Data Generator",
|
62 |
+
theme=theme,
|
63 |
+
)
|
64 |
+
|
65 |
+
|
66 |
+
if __name__ == "__main__":
|
67 |
+
demo.launch()
|