Spaces:
Runtime error
Runtime error
add user permissions to Dockerfile
Browse files- Dockerfile +6 -1
- main.py +0 -1
- requirements.txt +1 -2
Dockerfile
CHANGED
@@ -3,5 +3,10 @@ WORKDIR /app
|
|
3 |
COPY requirements.txt .
|
4 |
RUN --mount=type=secret,id=xlwnjlq93dru3lakgbpit7f7l
|
5 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
7 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
3 |
COPY requirements.txt .
|
4 |
RUN --mount=type=secret,id=xlwnjlq93dru3lakgbpit7f7l
|
5 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
6 |
+
RUN useradd -m -u 1000 user
|
7 |
+
USER user
|
8 |
+
ENV HOME=/home/user \
|
9 |
+
PATH=/home/user/.local/bin:$PATH
|
10 |
+
WORKDIR $HOME/app
|
11 |
+
COPY --chown=user . $HOME/app
|
12 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
main.py
CHANGED
@@ -15,7 +15,6 @@ import numpy as np
|
|
15 |
from numpy.linalg import norm
|
16 |
from nltk.tokenize import SpaceTokenizer
|
17 |
import nltk
|
18 |
-
import plotly.express as px
|
19 |
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
|
20 |
from dotenv import load_dotenv
|
21 |
load_dotenv()
|
|
|
15 |
from numpy.linalg import norm
|
16 |
from nltk.tokenize import SpaceTokenizer
|
17 |
import nltk
|
|
|
18 |
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
|
19 |
from dotenv import load_dotenv
|
20 |
load_dotenv()
|
requirements.txt
CHANGED
@@ -15,5 +15,4 @@ cohere==3.1.5
|
|
15 |
python-dotenv==0.21.1
|
16 |
transformers==4.25.1
|
17 |
torch==1.13.1
|
18 |
-
accelerate==0.16.0
|
19 |
-
plotly-express==0.4.1
|
|
|
15 |
python-dotenv==0.21.1
|
16 |
transformers==4.25.1
|
17 |
torch==1.13.1
|
18 |
+
accelerate==0.16.0
|
|