SeifElden2342532 commited on
Commit
c141a00
·
verified ·
1 Parent(s): 22218f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
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
- # We use gr.load to proxy the Gradio interface from Modal into Hugging Face
7
- # This makes it look and feel like a native Hugging Face Space
8
- demo = gr.load(src="models", name=MODAL_URL)
 
 
 
 
 
 
 
 
 
 
 
 
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()