Upload folder using huggingface_hub
Browse files- hate_speech_demo.py +36 -36
hate_speech_demo.py
CHANGED
|
@@ -821,42 +821,42 @@ def create_gradio_app():
|
|
| 821 |
# Hidden placeholder for retrieved knowledge
|
| 822 |
retrieved_knowledge = gr.HTML('', visible=False)
|
| 823 |
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
|
| 861 |
# Define show/hide loading indicator functions
|
| 862 |
def show_loading():
|
|
|
|
| 821 |
# Hidden placeholder for retrieved knowledge
|
| 822 |
retrieved_knowledge = gr.HTML('', visible=False)
|
| 823 |
|
| 824 |
+
with gr.Row():
|
| 825 |
+
with gr.Column(scale=1):
|
| 826 |
+
gr.HTML("""
|
| 827 |
+
<div>
|
| 828 |
+
<h3 class="result-header">🦙 LlamaGuard 3.0</h3>
|
| 829 |
+
<div style="margin-top: -10px; margin-bottom: 10px;">
|
| 830 |
+
<a href="https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard3/8B/MODEL_CARD.md"
|
| 831 |
+
target="_blank" class="knowledge-button">View model card</a>
|
| 832 |
+
</div>
|
| 833 |
+
</div>
|
| 834 |
+
""")
|
| 835 |
+
llama_results = gr.HTML('<div class="rating-box secondary-box empty-rating">Rating will appear here</div>')
|
| 836 |
+
|
| 837 |
+
with gr.Column(scale=1):
|
| 838 |
+
gr.HTML("""
|
| 839 |
+
<div>
|
| 840 |
+
<h3 class="result-header">🧷 OpenAI Moderation</h3>
|
| 841 |
+
<div style="margin-top: -10px; margin-bottom: 10px;">
|
| 842 |
+
<a href="https://platform.openai.com/docs/guides/moderation"
|
| 843 |
+
target="_blank" class="knowledge-button">View model card</a>
|
| 844 |
+
</div>
|
| 845 |
+
</div>
|
| 846 |
+
""")
|
| 847 |
+
openai_results = gr.HTML('<div class="rating-box secondary-box empty-rating">Rating will appear here</div>')
|
| 848 |
+
|
| 849 |
+
with gr.Column(scale=1):
|
| 850 |
+
gr.HTML("""
|
| 851 |
+
<div>
|
| 852 |
+
<h3 class="result-header">🧪 Perspective API</h3>
|
| 853 |
+
<div style="margin-top: -10px; margin-bottom: 10px;">
|
| 854 |
+
<a href="https://developers.perspectiveapi.com/s/docs"
|
| 855 |
+
target="_blank" class="knowledge-button">View docs</a>
|
| 856 |
+
</div>
|
| 857 |
+
</div>
|
| 858 |
+
""")
|
| 859 |
+
perspective_results = gr.HTML('<div class="rating-box secondary-box empty-rating">Rating will appear here</div>')
|
| 860 |
|
| 861 |
# Define show/hide loading indicator functions
|
| 862 |
def show_loading():
|