alessandro trinca tornidor commited on
Commit
4831035
1 Parent(s): 9e6aa30

[refactor] remove unused Dockerfile, script, update README.md

Browse files
Files changed (3) hide show
  1. README.md +7 -6
  2. dockerfiles/Dockerfile +0 -22
  3. scripts/entrypoint.sh +0 -25
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
  title: Gradio With Fastapi
3
- emoji: 🌖
4
- colorFrom: yellow
5
- colorTo: purple
6
  sdk: gradio
7
  sdk_version: 4.32.2
8
  app_file: app.py
@@ -28,7 +28,8 @@ python -m pip install -r requirements.txt
28
  # check that env $PATH contains the current virtualenv `venv/bin` folder
29
  # also try using a relative path, e.g. `./venv/bin/uvicorn` or reinstalling the virtualenv
30
  # fastapi==0.110.0, uvicorn==0.27.1
31
- uvicorn app_gradio_fastapi.main:app --host 0.0.0.0 --port 7860 --reload
 
32
  ```
33
 
34
  ## Run the app within a docker container
@@ -36,8 +37,8 @@ uvicorn app_gradio_fastapi.main:app --host 0.0.0.0 --port 7860 --reload
36
  Build the docker image and run the container:
37
 
38
  ```bash
39
- docker build . --tag app_gradio_fastapi --progress=plain
40
- docker run -d --name app_gradio_fastapi -p 7860:7860 app_gradio_fastapi; docker logs -f app_gradio_fastapi
41
  ```
42
 
43
  To stop all the container and remove all the docker images:
 
1
  ---
2
  title: Gradio With Fastapi
3
+ emoji:
4
+ colorFrom: blue
5
+ colorTo: red
6
  sdk: gradio
7
  sdk_version: 4.32.2
8
  app_file: app.py
 
28
  # check that env $PATH contains the current virtualenv `venv/bin` folder
29
  # also try using a relative path, e.g. `./venv/bin/uvicorn` or reinstalling the virtualenv
30
  # fastapi==0.110.0, uvicorn==0.27.1
31
+ # uvicorn app_gradio_fastapi.main:app --host 0.0.0.0 --port 7860 --reload
32
+ uvicorn app:app --host 0.0.0.0 --port 7860 --reload
33
  ```
34
 
35
  ## Run the app within a docker container
 
37
  Build the docker image and run the container:
38
 
39
  ```bash
40
+ # docker build . --tag app_gradio_fastapi --progress=plain
41
+ # docker run -d --name app_gradio_fastapi -p 7860:7860 app_gradio_fastapi; docker logs -f app_gradio_fastapi
42
  ```
43
 
44
  To stop all the container and remove all the docker images:
dockerfiles/Dockerfile DELETED
@@ -1,22 +0,0 @@
1
- FROM python:3.12-bookworm
2
-
3
- ARG PACKAGE_NAME="app_gradio_fastapi"
4
- ARG ROOT_DIR="/code"
5
- WORKDIR ${ROOT_DIR}
6
- RUN chmod 770 -R ${ROOT_DIR}/
7
-
8
- COPY ./requirements.txt ${ROOT_DIR}/requirements.txt
9
-
10
- RUN pip install pip --upgrade
11
- RUN python -m venv venv
12
- RUN . ${ROOT_DIR}/venv/bin/activate && pip install --no-cache-dir -r ${ROOT_DIR}/requirements.txt
13
-
14
- COPY ./scripts ${ROOT_DIR}/scripts
15
- COPY ./${PACKAGE_NAME} ${ROOT_DIR}/${PACKAGE_NAME}
16
-
17
- RUN chmod +x ${ROOT_DIR}/scripts/entrypoint.sh
18
-
19
- EXPOSE 7860
20
-
21
- CMD ["/code/scripts/entrypoint.sh"]
22
- # CMD ["uvicorn", "wrappers.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/entrypoint.sh DELETED
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- WORKDIR="/code"
4
-
5
- cd ${WORKDIR} || exit
6
- pwd
7
- source ${WORKDIR}/venv/bin/activate
8
-
9
- which python
10
- python --version
11
- which pip
12
- pip --version
13
-
14
- free -m
15
- pip list
16
- ls -l
17
- echo "uvicorn"
18
- which uvicorn
19
- ls -l ${WORKDIR}/venv/bin/uvicorn
20
-
21
- # python ${WORKDIR}/app.py --version='xinlai/LISA-13B-llama2-v1-explanatory' --precision='fp16' --load_in_4bit
22
- echo "uvicorn app_gradio_fastapi.main:app --host 0.0.0.0 --port 7860"
23
- uvicorn app_gradio_fastapi.main:app --host 0.0.0.0 --port 7860
24
-
25
- exit 0