Spaces:
Running
Running
Switch back to 8000 since huggingface doesn't allow 80
Browse files- Dockerfile +2 -2
- README.md +4 -1
- docker-compose.yml +2 -21
- nginx.conf +0 -15
Dockerfile
CHANGED
|
@@ -31,5 +31,5 @@ ENV PATH="/venv/bin:$PATH"
|
|
| 31 |
ENV TRANSFORMERS_CACHE=/coma-fixer/.cache
|
| 32 |
COPY --from=base /coma-fixer/.cache /coma-fixer/.cache
|
| 33 |
|
| 34 |
-
EXPOSE
|
| 35 |
-
CMD uvicorn "app:app" --port
|
|
|
|
| 31 |
ENV TRANSFORMERS_CACHE=/coma-fixer/.cache
|
| 32 |
COPY --from=base /coma-fixer/.cache /coma-fixer/.cache
|
| 33 |
|
| 34 |
+
EXPOSE 8000
|
| 35 |
+
CMD uvicorn "app:app" --port 8000 --host "0.0.0.0"
|
README.md
CHANGED
|
@@ -18,7 +18,10 @@ app_port: 8000
|
|
| 18 |
|
| 19 |
`git push hub` to deploy to huggingface hub, after adding a remote
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
| English | German | French | Italian |
|
| 24 |
|---------|--------|--------|---------|
|
|
|
|
| 18 |
|
| 19 |
`git push hub` to deploy to huggingface hub, after adding a remote
|
| 20 |
|
| 21 |
+
Multi-stage build brings down the size from 9GB+ to around 7GB.
|
| 22 |
+
Less not possible most likely, due to the size of torch and models.
|
| 23 |
+
|
| 24 |
+
Reported token classification F1 scores on commas for different languages, on a political speeches' dataset:
|
| 25 |
|
| 26 |
| English | German | French | Italian |
|
| 27 |
|---------|--------|--------|---------|
|
docker-compose.yml
CHANGED
|
@@ -1,32 +1,13 @@
|
|
| 1 |
version: '3.1'
|
| 2 |
|
| 3 |
services:
|
| 4 |
-
# nginx:
|
| 5 |
-
# image: nginx:latest
|
| 6 |
-
# container_name: nginx
|
| 7 |
-
# volumes:
|
| 8 |
-
# - ./:/comma-fixer
|
| 9 |
-
# - ./nginx.conf:/etc/nginx/conf.d/default.conf
|
| 10 |
-
# ports:
|
| 11 |
-
# - 8001:80
|
| 12 |
-
# networks:
|
| 13 |
-
# - my-network
|
| 14 |
-
# depends_on:
|
| 15 |
-
# - flask
|
| 16 |
comma-fixer:
|
| 17 |
build:
|
| 18 |
context: ./
|
| 19 |
dockerfile: Dockerfile
|
| 20 |
container_name: comma-fixer
|
| 21 |
-
command: uvicorn --host 0.0.0.0 --port
|
| 22 |
ports:
|
| 23 |
-
- "8000:
|
| 24 |
volumes:
|
| 25 |
- .:/comma-fixer
|
| 26 |
-
# networks:
|
| 27 |
-
# my-network:
|
| 28 |
-
# aliases:
|
| 29 |
-
# - comma-fixer
|
| 30 |
-
#
|
| 31 |
-
#networks:
|
| 32 |
-
# my-network:
|
|
|
|
| 1 |
version: '3.1'
|
| 2 |
|
| 3 |
services:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
comma-fixer:
|
| 5 |
build:
|
| 6 |
context: ./
|
| 7 |
dockerfile: Dockerfile
|
| 8 |
container_name: comma-fixer
|
| 9 |
+
command: uvicorn --host 0.0.0.0 --port 8000 "app:app" --reload
|
| 10 |
ports:
|
| 11 |
+
- "8000:8000"
|
| 12 |
volumes:
|
| 13 |
- .:/comma-fixer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nginx.conf
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
upstream flask-app {
|
| 2 |
-
server flask:8000;
|
| 3 |
-
}
|
| 4 |
-
|
| 5 |
-
server {
|
| 6 |
-
listen 80;
|
| 7 |
-
server_name localhost;
|
| 8 |
-
|
| 9 |
-
location / {
|
| 10 |
-
proxy_pass http://flask-app;
|
| 11 |
-
proxy_set_header Host "localhost";
|
| 12 |
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 13 |
-
proxy_redirect off;
|
| 14 |
-
}
|
| 15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|