Mazenbs commited on
Commit
012338c
·
1 Parent(s): a520cee

Add application file

Browse files
Files changed (3) hide show
  1. Dockerfile +13 -0
  2. main.py +13 -0
  3. requirements.txt +8 -0
Dockerfile ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
6
+
7
+ WORKDIR /app
8
+
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
+
12
+ COPY --chown=user . /app
13
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
main.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI()
4
+
5
+
6
+ @app.get("/hello")
7
+ def hello():
8
+ return {"hello": "xxxxxxxxxxxxxx"}
9
+
10
+
11
+ @app.get("/ping")
12
+ def ping():
13
+ return {"status": "ok", "message": "pong"}
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ transformers
4
+ numpy
5
+ sentencepiece
6
+ onnxruntime==1.20.1
7
+ onnxscript==0.1.0.dev20230907
8
+ onnx-graphsurgeon==0.5.2