Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- Hate Speech Policy.pdf +3 -0
- README.md +3 -9
- test.py +38 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
Hate[[:space:]]Speech[[:space:]]Policy.pdf filter=lfs diff=lfs merge=lfs -text
|
Hate Speech Policy.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0722f7379e6ebfb13fdf4595fbda155ead833f2258246f996b454e76f5b8ce39
|
3 |
+
size 487967
|
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 5.
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: test
|
3 |
+
app_file: test.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
+
sdk_version: 5.23.3
|
|
|
|
|
6 |
---
|
|
|
|
test.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def create_simple_pdf_viewer():
|
4 |
+
"""
|
5 |
+
Creates a simple Gradio app with just a button to view a PDF.
|
6 |
+
"""
|
7 |
+
with gr.Blocks() as app:
|
8 |
+
gr.Markdown("# Simple PDF Viewer")
|
9 |
+
|
10 |
+
# Create a button to trigger showing the PDF
|
11 |
+
view_button = gr.Button("View Hate Speech Policy")
|
12 |
+
|
13 |
+
# Create a file component that will display the PDF
|
14 |
+
pdf_viewer = gr.File(
|
15 |
+
value="Hate Speech Policy.pdf", # Path to your PDF file
|
16 |
+
label="Hate Speech Policy Document",
|
17 |
+
interactive=False,
|
18 |
+
visible=False # Initially hidden
|
19 |
+
)
|
20 |
+
|
21 |
+
# Define a simple function to show the PDF
|
22 |
+
def show_pdf():
|
23 |
+
return gr.update(visible=True)
|
24 |
+
|
25 |
+
# Connect the button to the function
|
26 |
+
view_button.click(
|
27 |
+
fn=show_pdf,
|
28 |
+
inputs=None,
|
29 |
+
outputs=pdf_viewer,
|
30 |
+
queue=False # No need for queue
|
31 |
+
)
|
32 |
+
|
33 |
+
return app
|
34 |
+
|
35 |
+
# Main function
|
36 |
+
if __name__ == "__main__":
|
37 |
+
app = create_simple_pdf_viewer()
|
38 |
+
app.launch()
|