Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ CSS = """
|
|
| 26 |
}
|
| 27 |
"""
|
| 28 |
|
| 29 |
-
with gr.Blocks(title="Visual Content Moderation", css=CSS) as demo:
|
| 30 |
gr.HTML("""
|
| 31 |
<div class="header">
|
| 32 |
<h1>Viddexa - Visual Content Moderation</h1>
|
|
@@ -75,12 +75,14 @@ with gr.Blocks(title="Visual Content Moderation", css=CSS) as demo:
|
|
| 75 |
with gr.Column(scale=1):
|
| 76 |
output = gr.Label(label="Classification Scores", num_top_classes=10)
|
| 77 |
|
|
|
|
| 78 |
gr.Examples(
|
| 79 |
-
examples=[[
|
| 80 |
-
inputs=[
|
| 81 |
outputs=output,
|
| 82 |
-
fn=lambda
|
| 83 |
cache_examples=False,
|
|
|
|
| 84 |
)
|
| 85 |
|
| 86 |
analyze_btn.click(
|
|
|
|
| 26 |
}
|
| 27 |
"""
|
| 28 |
|
| 29 |
+
with gr.Blocks(title="Visual Content Moderation", css=CSS, theme=gr.themes.Default(primary_hue=gr.themes.colors.teal)) as demo:
|
| 30 |
gr.HTML("""
|
| 31 |
<div class="header">
|
| 32 |
<h1>Viddexa - Visual Content Moderation</h1>
|
|
|
|
| 75 |
with gr.Column(scale=1):
|
| 76 |
output = gr.Label(label="Classification Scores", num_top_classes=10)
|
| 77 |
|
| 78 |
+
gr.Markdown("### 🎯 Try an Example")
|
| 79 |
gr.Examples(
|
| 80 |
+
examples=[[url, model] for url, model in EXAMPLE_ITEMS],
|
| 81 |
+
inputs=[url_input, model_choice],
|
| 82 |
outputs=output,
|
| 83 |
+
fn=lambda url, model: analyze(None, url, model, TOKEN),
|
| 84 |
cache_examples=False,
|
| 85 |
+
run_on_click=True,
|
| 86 |
)
|
| 87 |
|
| 88 |
analyze_btn.click(
|