Commit
·
0b1744f
1
Parent(s):
71c9a9a
Update Dockerfile
Browse files- Dockerfile +17 -8
Dockerfile
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
# Set the working directory
|
4 |
WORKDIR /code
|
@@ -6,14 +7,22 @@ WORKDIR /code
|
|
6 |
# Copy the requirements file
|
7 |
COPY ./requirements.txt /code/requirements.txt
|
8 |
|
9 |
-
# Copy the file or directory into the image (adjust the path as needed)
|
10 |
-
COPY ./gyesibiney/Sentiment-review-analysis-roberta-3 /code/gyesibiney/Sentiment-review-analysis-roberta-3
|
11 |
-
|
12 |
# Install requirements
|
13 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
14 |
|
15 |
-
#
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
#
|
19 |
-
CMD ["uvicorn", "
|
|
|
1 |
+
# Use a base image
|
2 |
+
FROM python:3.8
|
3 |
|
4 |
# Set the working directory
|
5 |
WORKDIR /code
|
|
|
7 |
# Copy the requirements file
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
9 |
|
|
|
|
|
|
|
10 |
# Install requirements
|
11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
12 |
|
13 |
+
# Add your application code here (e.g., FastAPI code)
|
14 |
+
COPY main.py .
|
15 |
+
# Install transformers library
|
16 |
+
RUN pip install transformers
|
17 |
+
|
18 |
+
# Specify the model name from Hugging Face
|
19 |
+
ARG MODEL_NAME="gyesibiney/covid-tweet-sentimental-Analysis-roberta"
|
20 |
+
|
21 |
+
# Download the model from Hugging Face (you can replace 'main' with a specific tag or version)
|
22 |
+
RUN transformers-cli login --api-key your_api_key_here
|
23 |
+
RUN transformers-cli repo clone $MODEL_NAME --path /code/model
|
24 |
+
|
25 |
+
# Add your application code here to use the downloaded model
|
26 |
|
27 |
+
# Example: Run your FastAPI application
|
28 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|