AndrewRqy commited on
Commit
cab22d8
·
1 Parent(s): b32b87d

BISECT: temporarily swap build_app() with minimal probe via BISECT_MINIMAL=1

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. app.py +12 -0
Dockerfile CHANGED
@@ -29,6 +29,7 @@ EXPOSE 7860
29
  ENV GRADIO_SERVER_NAME=0.0.0.0 \
30
  GRADIO_SERVER_PORT=7860 \
31
  GRADIO_ANALYTICS_ENABLED=False \
32
- PYTHONUNBUFFERED=1
 
33
 
34
  CMD ["python", "app.py"]
 
29
  ENV GRADIO_SERVER_NAME=0.0.0.0 \
30
  GRADIO_SERVER_PORT=7860 \
31
  GRADIO_ANALYTICS_ENABLED=False \
32
+ PYTHONUNBUFFERED=1 \
33
+ BISECT_MINIMAL=1
34
 
35
  CMD ["python", "app.py"]
app.py CHANGED
@@ -4991,6 +4991,18 @@ def run_self_test() -> int:
4991
 
4992
  if "--self-test" in sys.argv:
4993
  demo = None
 
 
 
 
 
 
 
 
 
 
 
 
4994
  else:
4995
  demo = build_app()
4996
 
 
4991
 
4992
  if "--self-test" in sys.argv:
4993
  demo = None
4994
+ elif os.environ.get("BISECT_MINIMAL") == "1":
4995
+ # Diagnostic bisect: if the App tab shows this minimal page, then the
4996
+ # full build_app() Blocks tree is what breaks iframe rendering. If it
4997
+ # ALSO shows nothing, the problem is outside build_app (Docker, port
4998
+ # routing, allowed_paths, etc).
4999
+ with gr.Blocks(title="The Apprentice — bisect probe") as demo:
5000
+ gr.Markdown("# BISECT PROBE")
5001
+ gr.Markdown(
5002
+ "If you can read this, the Docker + Gradio + iframe layers work. "
5003
+ "The full build_app() Blocks tree is what's breaking rendering."
5004
+ )
5005
+ gr.Button("Click me").click(lambda: "ok", outputs=gr.Textbox())
5006
  else:
5007
  demo = build_app()
5008