Spaces:
Sleeping
Sleeping
alessandro trinca tornidor
commited on
Commit
·
53b5c95
1
Parent(s):
4831035
[refactor] add packages.txt, remove unused section from README.md
Browse files- README.md +2 -20
- app.py +1 -1
- packages.txt +0 -0
README.md
CHANGED
|
@@ -19,8 +19,8 @@ license: mit
|
|
| 19 |
|
| 20 |
```bash
|
| 21 |
# create and activate a virtual environment
|
| 22 |
-
python3 -m venv venv
|
| 23 |
-
source venv/bin/activate
|
| 24 |
# install the project dependencies
|
| 25 |
python -m pip install pip --upgrade
|
| 26 |
python -m pip install -r requirements.txt
|
|
@@ -28,23 +28,5 @@ 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 |
uvicorn app:app --host 0.0.0.0 --port 7860 --reload
|
| 33 |
```
|
| 34 |
-
|
| 35 |
-
## Run the app within a docker container
|
| 36 |
-
|
| 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:
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
```bash
|
| 48 |
-
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
|
| 49 |
-
docker rmi $(docker images -q) -f
|
| 50 |
-
```
|
|
|
|
| 19 |
|
| 20 |
```bash
|
| 21 |
# create and activate a virtual environment
|
| 22 |
+
python3 -m venv .venv
|
| 23 |
+
source .venv/bin/activate
|
| 24 |
# install the project dependencies
|
| 25 |
python -m pip install pip --upgrade
|
| 26 |
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:app --host 0.0.0.0 --port 7860 --reload
|
| 32 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -9,7 +9,7 @@ from helpers import formatters, session_logger
|
|
| 9 |
|
| 10 |
|
| 11 |
session_logger.change_logging()
|
| 12 |
-
app = FastAPI(title="
|
| 13 |
logging.info("FastAPI app created, including routes...")
|
| 14 |
app.include_router(routes.router)
|
| 15 |
logging.info("routes included, creating gradio app")
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
session_logger.change_logging()
|
| 12 |
+
app = FastAPI(title="fastapi_with_gradio...", version="1.0")
|
| 13 |
logging.info("FastAPI app created, including routes...")
|
| 14 |
app.include_router(routes.router)
|
| 15 |
logging.info("routes included, creating gradio app")
|
packages.txt
ADDED
|
File without changes
|