ndurner commited on
Commit
57ac9fb
·
1 Parent(s): 09d7ed1

Gradio 6 demo app

Browse files
Files changed (4) hide show
  1. Dockerfile +17 -0
  2. README.md +13 -0
  3. demo/app.py +22 -0
  4. demo/requirements.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PIP_NO_CACHE_DIR=1
5
+
6
+ WORKDIR /app
7
+
8
+ COPY demo/requirements.txt demo/requirements.txt
9
+ RUN pip install --upgrade pip && \
10
+ pip install --pre -r demo/requirements.txt
11
+
12
+ COPY demo demo
13
+
14
+ EXPOSE 7860
15
+ ENV PORT=7860
16
+
17
+ CMD ["python", "demo/app.py"]
README.md CHANGED
@@ -13,3 +13,16 @@ tags:
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
16
+
17
+ ## Local development
18
+
19
+ Build and run the Docker Space image locally:
20
+
21
+ ```bash
22
+ docker build -t aileen3-core .
23
+ docker run -it -p 7860:7860 aileen3-core
24
+ ```
25
+
26
+ The Docker build passes `--pre` to `pip install` so it can grab the latest Gradio 6 pre-release builds referenced in `demo/requirements.txt`.
27
+
28
+ The blank Gradio 6 demo lives in `demo/app.py`.
demo/app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ import gradio as gr
4
+
5
+
6
+ def create_app() -> gr.Blocks:
7
+ """Return a blank Gradio interface for placeholder purposes."""
8
+ with gr.Blocks(title="Aileen3 Demo") as demo:
9
+ gr.HTML("")
10
+ return demo
11
+
12
+
13
+ def main() -> None:
14
+ app = create_app()
15
+ app.launch(
16
+ server_name="0.0.0.0",
17
+ server_port=int(os.environ.get("PORT", 7860)),
18
+ )
19
+
20
+
21
+ if __name__ == "__main__":
22
+ main()
demo/requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio>=6.0.0