Spaces:
Running
on
Zero
Running
on
Zero
Update static file serving route in app.py
Browse files
app.py
CHANGED
@@ -43,10 +43,10 @@ def predict(request: gr.Request, text_input):
|
|
43 |
</html>
|
44 |
""")
|
45 |
os.chmod(file_path, 0o644)
|
46 |
-
#
|
47 |
-
iframe = f'<iframe src="/
|
48 |
-
link = f'<a href="/
|
49 |
-
print("Serving file at URL:", f"/
|
50 |
return link, iframe
|
51 |
|
52 |
with gr.Blocks() as block:
|
|
|
43 |
</html>
|
44 |
""")
|
45 |
os.chmod(file_path, 0o644)
|
46 |
+
# Use the direct static route instead of Gradio's file route
|
47 |
+
iframe = f'<iframe src="/static/{file_name}" width="100%" height="500px"></iframe>'
|
48 |
+
link = f'<a href="/static/{file_name}" target="_blank">{file_name}</a>'
|
49 |
+
print("Serving file at URL:", f"/static/{file_name}")
|
50 |
return link, iframe
|
51 |
|
52 |
with gr.Blocks() as block:
|