rrg92 commited on
Commit
0c19631
1 Parent(s): 9a37d9e
Files changed (2) hide show
  1. SampleFile.txt +1 -0
  2. app.py +19 -0
SampleFile.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ This is a test file
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+
4
+ def GetFile():
5
+ return "https://huggingface.co/spaces/rrg92/GradioApiBug/raw/main/SampleFile.txt"
6
+
7
+
8
+ with gr.Blocks():
9
+ gr.Markdown("This space shows a problem with Gradio API when used inside Hugging Face Space.")
10
+ gr.Markdown("You can you any favorite http client to reproduce that. Use sample code bellow as reference")
11
+ gt.markdown("*Problem*: File url returned by Gradio API is incorrect")
12
+
13
+ btn = gr.Button("Click that button to start!")
14
+ fileResult = gr.File()
15
+ btn.click( GetFile, None, [fileResult] )
16
+
17
+
18
+ if __name__ == "__main__":
19
+ demo.launch(show_api=True)