Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,21 @@ import gradio as gr
|
|
| 3 |
# The URL of your deployed Modal app
|
| 4 |
MODAL_URL = "https://seifosama708--code-optimizer-app-web.modal.run"
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
# This
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
if __name__ == "__main__":
|
| 11 |
demo.launch()
|
|
|
|
| 3 |
# The URL of your deployed Modal app
|
| 4 |
MODAL_URL = "https://seifosama708--code-optimizer-app-web.modal.run"
|
| 5 |
|
| 6 |
+
# Using an iframe to embed the Modal app directly
|
| 7 |
+
# This is the most reliable way to display an external web server in a Space
|
| 8 |
+
with gr.Blocks(fill_height=True) as demo:
|
| 9 |
+
gr.HTML(
|
| 10 |
+
f"""
|
| 11 |
+
<iframe
|
| 12 |
+
src="{MODAL_URL}"
|
| 13 |
+
width="100%"
|
| 14 |
+
height="100%"
|
| 15 |
+
style="border:none; min-height:800px;"
|
| 16 |
+
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
|
| 17 |
+
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"
|
| 18 |
+
></iframe>
|
| 19 |
+
"""
|
| 20 |
+
)
|
| 21 |
|
| 22 |
if __name__ == "__main__":
|
| 23 |
demo.launch()
|