rydlrKE commited on
Commit
c8e8829
·
1 Parent(s): adbafd9

Space: force native UI proxy and remove fallback iframe switching

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -70,10 +70,9 @@ def _gpu_healthcheck() -> str:
70
 
71
 
72
  def _viewer_html() -> str:
73
- if bool(_state.get("ok")):
74
- src = f"/proxy/{NATIVE_PORT}/"
75
- else:
76
- src = os.environ.get("KIMODO_UI_URL", "https://nvidia-kimodo.hf.space").strip()
77
  return (
78
  "<div style='border:1px solid #d9e7ef;border-radius:12px;overflow:hidden;'>"
79
  f"<iframe src='{src}' title='Kimodo UI' style='width:100%;border:0' "
@@ -87,11 +86,8 @@ def _status_markdown() -> str:
87
  return f"Native demo running on /proxy/{NATIVE_PORT}/."
88
  err = _state.get("error")
89
  if err:
90
- return (
91
- "Native demo unavailable, showing fallback UI. "
92
- f"Reason: {err}"
93
- )
94
- return "Starting native demo..."
95
 
96
 
97
  def _refresh() -> tuple[str, str]:
 
70
 
71
 
72
  def _viewer_html() -> str:
73
+ # Always target the native Viser app on this Space. This avoids serving
74
+ # an external fallback UI that can diverge from the deployed code/assets.
75
+ src = f"/proxy/{NATIVE_PORT}/"
 
76
  return (
77
  "<div style='border:1px solid #d9e7ef;border-radius:12px;overflow:hidden;'>"
78
  f"<iframe src='{src}' title='Kimodo UI' style='width:100%;border:0' "
 
86
  return f"Native demo running on /proxy/{NATIVE_PORT}/."
87
  err = _state.get("error")
88
  if err:
89
+ return f"Native demo failed to start. Reason: {err}"
90
+ return f"Starting native demo on /proxy/{NATIVE_PORT}/..."
 
 
 
91
 
92
 
93
  def _refresh() -> tuple[str, str]: