Upload 3 files
Browse files- Dockerfile +3 -3
- app.py +1 -2
Dockerfile
CHANGED
@@ -4,14 +4,14 @@ COPY ./requirements.txt /code/requirements.txt
|
|
4 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
5 |
RUN useradd user
|
6 |
USER user
|
7 |
-
ENV HOME
|
8 |
PATH=/home/user/.local/bin:$PATH
|
9 |
WORKDIR $HOME/app
|
10 |
COPY --chown=user . $HOME/app
|
11 |
-
CMD ["uvicorn", "app:app","--host", "0.0.0.0", "--port", "
|
12 |
|
13 |
|
14 |
-
# FROM python:3.9
|
15 |
# Specifies that the base image is Python 3.9.
|
16 |
|
17 |
# WORKDIR /code
|
|
|
4 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
5 |
RUN useradd user
|
6 |
USER user
|
7 |
+
ENV HOME=/home/user \
|
8 |
PATH=/home/user/.local/bin:$PATH
|
9 |
WORKDIR $HOME/app
|
10 |
COPY --chown=user . $HOME/app
|
11 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
12 |
|
13 |
|
14 |
+
# FROM python:3.9
|
15 |
# Specifies that the base image is Python 3.9.
|
16 |
|
17 |
# WORKDIR /code
|
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
3 |
-
|
4 |
-
app= FastAPI()
|
5 |
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
6 |
@app.get("/")
|
7 |
def home():
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
3 |
+
app=FastAPI()
|
|
|
4 |
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
5 |
@app.get("/")
|
6 |
def home():
|