Shunfeng Zheng commited on
Commit
00d9204
·
1 Parent(s): b5afd3e

Deploy gradio 4.19.2 backend via Docker

Browse files
Files changed (3) hide show
  1. Dockerfile +10 -0
  2. app.py +8 -0
  3. requirements.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ WORKDIR /app
4
+
5
+ COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
+
8
+ COPY app.py .
9
+
10
+ CMD ["python", "app.py"]
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ print("Gradio version:", gr.__version__)
3
+
4
+ def parse_spatial(text):
5
+ return f"[Parsed Spatial Info] {text.upper()}"
6
+
7
+ demo = gr.Interface(fn=parse_spatial, inputs="text", outputs="text")
8
+ demo.launch(api_name="predict")
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio==4.19.2