From 7de7c916b15ae3d6310bed1a9bd793da2d4a1a56 Mon Sep 17 00:00:00 2001 From: zhh Date: Mon, 27 Oct 2025 16:51:16 +0800 Subject: [PATCH] first commit --- .gitignore | 8 +++++++- Dockerfile | 3 ++- docker-compose.yml | 18 ++++++++++++++++++ litserver_main.py | 4 ++-- requirements-GPU.txt | 4 ++-- 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore index ce5315f..136fa9d 100644 --- a/.gitignore +++ b/.gitignore @@ -170,4 +170,10 @@ aaa.md *_test.py img.jpg test_data -testsrc.mp4 \ No newline at end of file +testsrc.mp4 + +*.jpg +*.png +*.pth +.idea +*.jpeg \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 81bdc6c..0b17b69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,4 +36,5 @@ RUN pip install --no-cache-dir litserve==0.2.16 RUN pip install -r requirements-GPU.txt RUN pip install opencv-python EXPOSE 8000 -CMD ["python", "/app/litserver_main.py"] +#CMD ["python", "/app/litserver_main.py"] +CMD ["tail", "-f","/dev/null"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..32f4c50 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + lc_neo_refacer: + build: + context: . + dockerfile: Dockerfile + working_dir: /app + volumes: + - .:/app + ports: + - "10071:8000" + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: + - gpu \ No newline at end of file diff --git a/litserver_main.py b/litserver_main.py index e1783c0..e799eae 100644 --- a/litserver_main.py +++ b/litserver_main.py @@ -66,5 +66,5 @@ class InferencePipeline(ls.LitAPI): if __name__ == '__main__': api = InferencePipeline() - server = ls.LitServer(api, accelerator="gpu") - server.run(port=8080) + server = ls.LitServer(api, accelerator="auto") + server.run(port=8000) diff --git a/requirements-GPU.txt b/requirements-GPU.txt index fad8568..2d2b27f 100644 --- a/requirements-GPU.txt +++ b/requirements-GPU.txt @@ -14,8 +14,8 @@ psutil==7.0.0 ngrok==1.4.0 pyfiglet==1.0.2 # codeformer dependencies -# torch==2.6.0 -# torchvision==0.21.0 +torch==2.6.0 +torchvision==0.21.0 gdown==5.2.0 lpips==0.1.4 opencv-python