TripleKdev commited on
Commit
59e5efb
1 Parent(s): c2f292a
Files changed (3) hide show
  1. .dockerfile +20 -0
  2. .gitattributes +2 -0
  3. app.py +1 -1
.dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python image from the Docker Hub
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file into the container at /app
8
+ COPY requirements.txt requirements.txt
9
+
10
+ # Install the dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Copy the rest of the application code into the container at /app
14
+ COPY . .
15
+
16
+ # Expose port 8000 for the FastAPI app
17
+ EXPOSE 8000
18
+
19
+ # Command to run the FastAPI app using Uvicorn
20
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
.gitattributes CHANGED
@@ -1 +1,3 @@
1
  *.pth filter=lfs diff=lfs merge=lfs -text
 
 
 
1
  *.pth filter=lfs diff=lfs merge=lfs -text
2
+ *.pth"
3
+ filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -19,7 +19,7 @@ model.classifier[6] = nn.Linear(4096, 2)
19
  model.load_state_dict(torch.load('model_vgg16.pth' , map_location=device))
20
 
21
  model.eval()
22
-
23
  transform = T.Compose([
24
  T.Resize((224, 224)),
25
  T.ToTensor(),
 
19
  model.load_state_dict(torch.load('model_vgg16.pth' , map_location=device))
20
 
21
  model.eval()
22
+ s
23
  transform = T.Compose([
24
  T.Resize((224, 224)),
25
  T.ToTensor(),