Spaces:
Running
Running
Upload with huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +6 -6
- app.py +29 -0
- screenshot.gif +3 -0
.gitattributes
CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
32 |
+
screenshot.gif filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.3.1
|
|
|
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 |
---
|
3 |
+
title: blocks_flipper
|
4 |
+
emoji: 🔥
|
5 |
+
colorFrom: indigo
|
6 |
+
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
sdk_version: 3.3.1
|
9 |
+
|
10 |
app_file: app.py
|
11 |
pinned: false
|
12 |
---
|
|
|
|
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def flip_text(x):
|
5 |
+
return x[::-1]
|
6 |
+
|
7 |
+
def flip_image(x):
|
8 |
+
return np.fliplr(x)
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown("Flip text or image files using this demo.")
|
12 |
+
with gr.Tab("Flip Text"):
|
13 |
+
text_input = gr.Textbox()
|
14 |
+
text_output = gr.Textbox()
|
15 |
+
text_button = gr.Button("Flip")
|
16 |
+
with gr.Tab("Flip Image"):
|
17 |
+
with gr.Row():
|
18 |
+
image_input = gr.Image()
|
19 |
+
image_output = gr.Image()
|
20 |
+
image_button = gr.Button("Flip")
|
21 |
+
|
22 |
+
with gr.Accordion("Open for More!"):
|
23 |
+
gr.Markdown("Look at me...")
|
24 |
+
|
25 |
+
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
26 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
demo.launch()
|
screenshot.gif
ADDED
Git LFS Details
|