gyesibiney commited on
Commit
0b1744f
·
1 Parent(s): 71c9a9a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -8
Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
- FROM python:3.9
 
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
- # Expose the port the FastAPI app will run on
16
- EXPOSE 7860
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- # The CMD instruction specifies the command to run when the container starts
19
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
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"]