Upload folder using huggingface_hub
Browse files- hate_speech_demo.py +9 -19
hate_speech_demo.py
CHANGED
|
@@ -873,25 +873,15 @@ def create_gradio_app():
|
|
| 873 |
|
| 874 |
// Function to handle opening the policy popup
|
| 875 |
function openPolicyPopup() {
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
// Try to find the URL first
|
| 886 |
-
const url = findPdfUrl();
|
| 887 |
-
if (url) {
|
| 888 |
-
loadPolicyPdf(url);
|
| 889 |
-
} else {
|
| 890 |
-
// Show fallback if we can't find the URL
|
| 891 |
-
document.getElementById("pdf-loading").style.display = "none";
|
| 892 |
-
document.getElementById("policy-iframe").style.display = "none";
|
| 893 |
-
document.getElementById("policy-fallback").style.display = "block";
|
| 894 |
-
}
|
| 895 |
}
|
| 896 |
}
|
| 897 |
}
|
|
|
|
| 873 |
|
| 874 |
// Function to handle opening the policy popup
|
| 875 |
function openPolicyPopup() {
|
| 876 |
+
document.getElementById('policy-popup').style.display = 'flex';
|
| 877 |
+
|
| 878 |
+
const iframe = document.getElementById("policy-iframe");
|
| 879 |
+
iframe.src = "/file=Hate%20Speech%20Policy.pdf";
|
| 880 |
+
|
| 881 |
+
document.getElementById("pdf-loading").style.display = "none";
|
| 882 |
+
document.getElementById("policy-fallback").style.display = "none";
|
| 883 |
+
iframe.style.display = "block";
|
| 884 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 885 |
}
|
| 886 |
}
|
| 887 |
}
|