m7n commited on
Commit
a2565cd
·
1 Parent(s): 30ba848

added slash to file

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -33,11 +33,11 @@ def predict(request: gr.Request,text_input):
33
  </body>
34
  </html>
35
  """)
36
- iframe = f"""<iframe src="file={file_path}" width="100%" height="500px"></iframe>"""
37
- link = f'<a href="file={file_path}" target="_blank">{file_name}</a>'
 
38
  return link, iframe
39
 
40
-
41
  with gr.Blocks() as block:
42
  gr.Markdown("""
43
  ## Gradio + FastAPI + Static Server
 
33
  </body>
34
  </html>
35
  """)
36
+ iframe = f'<iframe src="/file=static/{file_name}" width="100%" height="500px"></iframe>'
37
+ link = f'<a href="/file=static/{file_name}" target="_blank">{file_name}</a>'
38
+ print("Serving file at:", f"/file=static/{file_name}")
39
  return link, iframe
40
 
 
41
  with gr.Blocks() as block:
42
  gr.Markdown("""
43
  ## Gradio + FastAPI + Static Server