Spaces:
Running
Running
Upload with huggingface_hub
Browse files- README.md +6 -6
- app.py +16 -0
- config.json +68 -0
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: input_output
|
| 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,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def image_mod(text):
|
| 5 |
+
return text[::-1]
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
demo = gr.Blocks()
|
| 9 |
+
|
| 10 |
+
with demo:
|
| 11 |
+
text = gr.Textbox(label="Input-Output")
|
| 12 |
+
btn = gr.Button("Run")
|
| 13 |
+
btn.click(image_mod, text, text)
|
| 14 |
+
|
| 15 |
+
if __name__ == "__main__":
|
| 16 |
+
demo.launch()
|
config.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "3.1.4",
|
| 3 |
+
"mode": "blocks",
|
| 4 |
+
"dev_mode": true,
|
| 5 |
+
"components": [
|
| 6 |
+
{
|
| 7 |
+
"id": 1,
|
| 8 |
+
"type": "textbox",
|
| 9 |
+
"props": {
|
| 10 |
+
"lines": 1,
|
| 11 |
+
"max_lines": 20,
|
| 12 |
+
"value": "",
|
| 13 |
+
"label": "Input-Output",
|
| 14 |
+
"show_label": true,
|
| 15 |
+
"name": "textbox",
|
| 16 |
+
"visible": true,
|
| 17 |
+
"style": {}
|
| 18 |
+
}
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"id": 2,
|
| 22 |
+
"type": "button",
|
| 23 |
+
"props": {
|
| 24 |
+
"value": "Run",
|
| 25 |
+
"variant": "secondary",
|
| 26 |
+
"name": "button",
|
| 27 |
+
"visible": true,
|
| 28 |
+
"style": {}
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
],
|
| 32 |
+
"theme": "default",
|
| 33 |
+
"css": null,
|
| 34 |
+
"title": "Gradio",
|
| 35 |
+
"enable_queue": false,
|
| 36 |
+
"layout": {
|
| 37 |
+
"id": 0,
|
| 38 |
+
"children": [
|
| 39 |
+
{
|
| 40 |
+
"id": 1
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"id": 2
|
| 44 |
+
}
|
| 45 |
+
]
|
| 46 |
+
},
|
| 47 |
+
"dependencies": [
|
| 48 |
+
{
|
| 49 |
+
"targets": [
|
| 50 |
+
2
|
| 51 |
+
],
|
| 52 |
+
"trigger": "click",
|
| 53 |
+
"inputs": [
|
| 54 |
+
1
|
| 55 |
+
],
|
| 56 |
+
"outputs": [
|
| 57 |
+
1
|
| 58 |
+
],
|
| 59 |
+
"backend_fn": true,
|
| 60 |
+
"js": null,
|
| 61 |
+
"status_tracker": null,
|
| 62 |
+
"queue": null,
|
| 63 |
+
"api_name": null,
|
| 64 |
+
"scroll_to_output": false,
|
| 65 |
+
"show_progress": true
|
| 66 |
+
}
|
| 67 |
+
]
|
| 68 |
+
}
|