John6666 commited on
Commit
fe3fa2d
·
verified ·
1 Parent(s): fb7d2f9

Upload 4 files

Browse files
Files changed (4) hide show
  1. README.md +13 -12
  2. app.py +18 -0
  3. tmp/a.txt +1 -0
  4. tmp2/a.txt +1 -0
README.md CHANGED
@@ -1,12 +1,13 @@
1
- ---
2
- title: File Test
3
- emoji: 🏢
4
- colorFrom: blue
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 5.25.2
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: 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