Skip to content

Commit

Permalink
feat: Updated src/api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-nightly[bot] authored Nov 25, 2023
1 parent 7a0e73c commit 7700842
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from fastapi import FastAPI, UploadFile, File
from PIL import Image
import torch
from fastapi import FastAPI, File, UploadFile
from main import Trainer # Importing Net class from main.py
from PIL import Image
from torchvision import transforms
from main import Net # Importing Net class from main.py

# Load the model
model = Net()
model.load_state_dict(torch.load("mnist_model.pth"))
trainer = Trainer()
model = trainer.model
model.eval()

# Transform used for preprocessing the image
Expand Down

0 comments on commit 7700842

Please sign in to comment.