Spaces:
Running
Running
bitliu
commited on
Commit
·
ca9429f
1
Parent(s):
9a37117
init
Browse filesSigned-off-by: bitliu <bitliu@tencent.com>
- app.py +34 -13
- requirements.txt +1 -1
- vllm-logo.png +0 -0
app.py
CHANGED
|
@@ -175,15 +175,31 @@ EXAMPLES_PII = [
|
|
| 175 |
]
|
| 176 |
|
| 177 |
# ============== Gradio Interface ==============
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
""
|
| 186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
with gr.Tabs():
|
| 189 |
# Tab 1: Fact Check
|
|
@@ -256,12 +272,17 @@ with gr.Blocks(title="LLM Semantic Router - Model Playground", theme=gr.themes.S
|
|
| 256 |
ner_btn.click(classify_tokens, ner_input, [ner_output, ner_highlight])
|
| 257 |
ner_input.submit(classify_tokens, ner_input, [ner_output, ner_highlight])
|
| 258 |
|
| 259 |
-
gr.
|
| 260 |
"""
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
"""
|
| 266 |
)
|
| 267 |
|
|
|
|
| 175 |
]
|
| 176 |
|
| 177 |
# ============== Gradio Interface ==============
|
| 178 |
+
custom_css = """
|
| 179 |
+
.gradio-container {
|
| 180 |
+
max-width: 1200px !important;
|
| 181 |
+
}
|
| 182 |
+
.header-logo {
|
| 183 |
+
display: flex;
|
| 184 |
+
align-items: center;
|
| 185 |
+
gap: 20px;
|
| 186 |
+
margin-bottom: 10px;
|
| 187 |
+
}
|
| 188 |
+
.header-logo img {
|
| 189 |
+
height: 50px;
|
| 190 |
+
}
|
| 191 |
+
"""
|
| 192 |
|
| 193 |
+
with gr.Blocks(title="LLM Semantic Router - Model Playground", css=custom_css) as demo:
|
| 194 |
+
with gr.Row():
|
| 195 |
+
gr.Image("vllm-logo.png", show_label=False, height=60, width=120,
|
| 196 |
+
container=False, show_download_button=False)
|
| 197 |
+
gr.Markdown(
|
| 198 |
+
"""
|
| 199 |
+
# 🚀 LLM Semantic Router
|
| 200 |
+
**Model Playground** - ModernBERT Classifiers for LLM Safety & Routing
|
| 201 |
+
"""
|
| 202 |
+
)
|
| 203 |
|
| 204 |
with gr.Tabs():
|
| 205 |
# Tab 1: Fact Check
|
|
|
|
| 272 |
ner_btn.click(classify_tokens, ner_input, [ner_output, ner_highlight])
|
| 273 |
ner_input.submit(classify_tokens, ner_input, [ner_output, ner_highlight])
|
| 274 |
|
| 275 |
+
gr.HTML(
|
| 276 |
"""
|
| 277 |
+
<hr style="margin-top: 30px;">
|
| 278 |
+
<div style="text-align: center; color: #666; font-size: 14px;">
|
| 279 |
+
<p>
|
| 280 |
+
<strong>Models</strong>: <a href="https://huggingface.co/LLM-Semantic-Router" target="_blank">LLM-Semantic-Router</a> |
|
| 281 |
+
<strong>Architecture</strong>: ModernBERT |
|
| 282 |
+
<strong>GitHub</strong>: <a href="https://github.com/vllm-project/semantic-router" target="_blank">vllm-project/semantic-router</a>
|
| 283 |
+
</p>
|
| 284 |
+
<p>Part of the <a href="https://github.com/vllm-project/vllm" target="_blank">vLLM</a> ecosystem</p>
|
| 285 |
+
</div>
|
| 286 |
"""
|
| 287 |
)
|
| 288 |
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
torch
|
| 2 |
transformers>=4.56.0
|
| 3 |
-
gradio>=
|
| 4 |
|
|
|
|
| 1 |
torch
|
| 2 |
transformers>=4.56.0
|
| 3 |
+
gradio>=5.0.0
|
| 4 |
|
vllm-logo.png
ADDED
|