Upload 4 files
Browse files
README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: file access test
|
| 3 |
+
emoji: 🙄
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.24.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
print("test1")
|
| 5 |
+
# write your code here or there
|
| 6 |
+
|
| 7 |
+
def test():
|
| 8 |
+
return "test2"
|
| 9 |
+
|
| 10 |
+
with gr.Blocks() as demo:
|
| 11 |
+
gr.Markdown("http://john6666-file-test.hf.space/gradio_api/file=tmp/a.txt")
|
| 12 |
+
gr.Markdown("http://john6666-file-test.hf.space/gradio_api/file=tmp2/a.txt")
|
| 13 |
+
run_button = gr.Button("Run", variant="primary")
|
| 14 |
+
info = gr.Textbox(label="Output", value="", show_copy_button=True)
|
| 15 |
+
|
| 16 |
+
run_button.click(test, None, [info])
|
| 17 |
+
|
| 18 |
+
demo.launch(ssr_mode=False, allowed_paths=["./tmp/"])
|
tmp/a.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
huggingface_hub
|
tmp2/a.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
huggingface_hub
|