Upload app.py
Browse files
app.py
CHANGED
|
@@ -35,8 +35,7 @@ UI = {
|
|
| 35 |
|
| 36 |
MODEL_LINK = "https://huggingface.co/Setur/BRAGD"
|
| 37 |
|
| 38 |
-
CSS = """
|
| 39 |
-
:root{
|
| 40 |
--primary-500:#89AFA9; --primary-600:#6F9992; --primary-700:#5B7F79;
|
| 41 |
--primary-100:#E1ECEA; --primary-200:#C6DAD6;
|
| 42 |
--page-bg:#f7f7f8;
|
|
@@ -51,7 +50,7 @@ body, .gradio-container, .prose, .markdown, textarea, input, select, button, tab
|
|
| 51 |
}
|
| 52 |
a{ color:var(--primary-700)!important; }
|
| 53 |
|
| 54 |
-
/* Primary button */
|
| 55 |
.gr-button-primary, button.primary, .primary{
|
| 56 |
background:var(--primary-500)!important;
|
| 57 |
border-color:var(--primary-600)!important;
|
|
@@ -60,7 +59,7 @@ a{ color:var(--primary-700)!important; }
|
|
| 60 |
.gr-button-primary:hover, button.primary:hover, .primary:hover{ background:var(--primary-600)!important; }
|
| 61 |
.gr-button-primary{ padding:0.35rem 0.85rem!important; font-size:0.95rem!important; }
|
| 62 |
|
| 63 |
-
/* ---
|
| 64 |
#input_col, #input_col *{
|
| 65 |
background: transparent !important;
|
| 66 |
}
|
|
@@ -74,7 +73,6 @@ a{ color:var(--primary-700)!important; }
|
|
| 74 |
box-shadow:none !important;
|
| 75 |
border:0 !important;
|
| 76 |
}
|
| 77 |
-
/* Keep the actual typing area white */
|
| 78 |
#input_box textarea{
|
| 79 |
background:#ffffff !important;
|
| 80 |
}
|
|
@@ -91,47 +89,88 @@ a{ color:var(--primary-700)!important; }
|
|
| 91 |
white-space: normal !important; width: 64% !important;
|
| 92 |
}
|
| 93 |
|
| 94 |
-
/* Results header row:
|
| 95 |
#results_hdr{
|
| 96 |
display:flex;
|
| 97 |
align-items:center;
|
| 98 |
justify-content:space-between;
|
| 99 |
gap:12px;
|
| 100 |
-
padding:0;
|
|
|
|
| 101 |
background:transparent !important;
|
|
|
|
|
|
|
| 102 |
}
|
| 103 |
-
#results_hdr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
background:transparent !important;
|
| 105 |
box-shadow:none !important;
|
| 106 |
border:0 !important;
|
| 107 |
}
|
| 108 |
|
| 109 |
-
/* Language toggle
|
| 110 |
-
.lang_toggle
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
.lang_toggle label span{
|
|
|
|
|
|
|
| 116 |
display:inline-block;
|
|
|
|
|
|
|
| 117 |
padding:0.35rem 0.85rem;
|
| 118 |
font-size:0.95rem;
|
| 119 |
border-radius:10px;
|
| 120 |
border:1px solid var(--primary-600);
|
| 121 |
-
background:transparent;
|
| 122 |
color:#0b1b19;
|
|
|
|
|
|
|
| 123 |
}
|
| 124 |
-
|
| 125 |
-
/* Selected = exactly like Marka button */
|
| 126 |
.lang_toggle input:checked + span{
|
| 127 |
background:var(--primary-500)!important;
|
| 128 |
border-color:var(--primary-600)!important;
|
| 129 |
color:#0b1b19!important;
|
| 130 |
}
|
|
|
|
| 131 |
.lang_toggle label:hover span{
|
| 132 |
-
background:var(--primary-200);
|
| 133 |
-
}
|
| 134 |
-
"""
|
| 135 |
|
| 136 |
# ----------------------------
|
| 137 |
# Tokenization
|
|
|
|
| 35 |
|
| 36 |
MODEL_LINK = "https://huggingface.co/Setur/BRAGD"
|
| 37 |
|
| 38 |
+
CSS = """:root{
|
|
|
|
| 39 |
--primary-500:#89AFA9; --primary-600:#6F9992; --primary-700:#5B7F79;
|
| 40 |
--primary-100:#E1ECEA; --primary-200:#C6DAD6;
|
| 41 |
--page-bg:#f7f7f8;
|
|
|
|
| 50 |
}
|
| 51 |
a{ color:var(--primary-700)!important; }
|
| 52 |
|
| 53 |
+
/* Primary button (Marka/Tag) */
|
| 54 |
.gr-button-primary, button.primary, .primary{
|
| 55 |
background:var(--primary-500)!important;
|
| 56 |
border-color:var(--primary-600)!important;
|
|
|
|
| 59 |
.gr-button-primary:hover, button.primary:hover, .primary:hover{ background:var(--primary-600)!important; }
|
| 60 |
.gr-button-primary{ padding:0.35rem 0.85rem!important; font-size:0.95rem!important; }
|
| 61 |
|
| 62 |
+
/* --- Keep the textbox exactly as-is: wrapper blends with page, textarea stays white --- */
|
| 63 |
#input_col, #input_col *{
|
| 64 |
background: transparent !important;
|
| 65 |
}
|
|
|
|
| 73 |
box-shadow:none !important;
|
| 74 |
border:0 !important;
|
| 75 |
}
|
|
|
|
| 76 |
#input_box textarea{
|
| 77 |
background:#ffffff !important;
|
| 78 |
}
|
|
|
|
| 89 |
white-space: normal !important; width: 64% !important;
|
| 90 |
}
|
| 91 |
|
| 92 |
+
/* Results header row: kill ALL white "cards"/panels behind the language buttons */
|
| 93 |
#results_hdr{
|
| 94 |
display:flex;
|
| 95 |
align-items:center;
|
| 96 |
justify-content:space-between;
|
| 97 |
gap:12px;
|
| 98 |
+
padding:0 !important;
|
| 99 |
+
margin:0 !important;
|
| 100 |
background:transparent !important;
|
| 101 |
+
box-shadow:none !important;
|
| 102 |
+
border:0 !important;
|
| 103 |
}
|
| 104 |
+
#results_hdr, #results_hdr *{
|
| 105 |
+
background:transparent !important;
|
| 106 |
+
box-shadow:none !important;
|
| 107 |
+
}
|
| 108 |
+
#results_hdr .gr-block,
|
| 109 |
+
#results_hdr .gr-panel,
|
| 110 |
+
#results_hdr .gr-box,
|
| 111 |
+
#results_hdr .gr-group,
|
| 112 |
+
#results_hdr .gr-form,
|
| 113 |
+
#results_hdr .gr-row,
|
| 114 |
+
#results_hdr .gr-column{
|
| 115 |
background:transparent !important;
|
| 116 |
box-shadow:none !important;
|
| 117 |
border:0 !important;
|
| 118 |
}
|
| 119 |
|
| 120 |
+
/* Language toggle (gr.Radio) — remove Gradio's own button styling, keep only ours */
|
| 121 |
+
.lang_toggle{
|
| 122 |
+
background: transparent !important;
|
| 123 |
+
}
|
| 124 |
+
.lang_toggle fieldset{
|
| 125 |
+
border:0!important;
|
| 126 |
+
padding:0!important;
|
| 127 |
+
margin:0!important;
|
| 128 |
+
background:transparent!important;
|
| 129 |
+
}
|
| 130 |
+
.lang_toggle .wrap{
|
| 131 |
+
display:flex!important;
|
| 132 |
+
gap:10px!important;
|
| 133 |
+
background:transparent!important;
|
| 134 |
+
padding:0!important;
|
| 135 |
+
margin:0!important;
|
| 136 |
+
}
|
| 137 |
+
.lang_toggle label{
|
| 138 |
+
/* This removes the OUTER "button" Gradio paints */
|
| 139 |
+
background:transparent!important;
|
| 140 |
+
border:0!important;
|
| 141 |
+
padding:0!important;
|
| 142 |
+
margin:0!important;
|
| 143 |
+
box-shadow:none!important;
|
| 144 |
+
border-radius:0!important;
|
| 145 |
+
}
|
| 146 |
+
.lang_toggle input{
|
| 147 |
+
display:none!important; /* no cursor, no default radio */
|
| 148 |
+
}
|
| 149 |
.lang_toggle label span{
|
| 150 |
+
/* This is the ONLY visible button layer */
|
| 151 |
+
all: unset;
|
| 152 |
display:inline-block;
|
| 153 |
+
cursor:pointer;
|
| 154 |
+
user-select:none;
|
| 155 |
padding:0.35rem 0.85rem;
|
| 156 |
font-size:0.95rem;
|
| 157 |
border-radius:10px;
|
| 158 |
border:1px solid var(--primary-600);
|
| 159 |
+
background: transparent; /* same as page background */
|
| 160 |
color:#0b1b19;
|
| 161 |
+
box-shadow:none!important;
|
| 162 |
+
outline:none!important;
|
| 163 |
}
|
| 164 |
+
/* Selected = match Marka/Tag exactly */
|
|
|
|
| 165 |
.lang_toggle input:checked + span{
|
| 166 |
background:var(--primary-500)!important;
|
| 167 |
border-color:var(--primary-600)!important;
|
| 168 |
color:#0b1b19!important;
|
| 169 |
}
|
| 170 |
+
/* Hover = subtle */
|
| 171 |
.lang_toggle label:hover span{
|
| 172 |
+
background:var(--primary-200)!important;
|
| 173 |
+
}"""
|
|
|
|
| 174 |
|
| 175 |
# ----------------------------
|
| 176 |
# Tokenization
|