Ashrafb commited on
Commit
6767de4
·
verified ·
1 Parent(s): d4dc97e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -5,13 +5,13 @@ from fastapi import FastAPI, File, UploadFile
5
  from pydantic import BaseModel
6
  import numpy as np
7
  import cv2
 
8
  from vtoonify_model import Model
9
 
10
  app = FastAPI()
11
 
12
  # Load the model
13
- device = "cuda" if torch.cuda.is_available() else "cpu"
14
- model = Model(device)
15
  exstyle, message = model.load_model("cartoon1")
16
 
17
  class ImageRequest(BaseModel):
 
5
  from pydantic import BaseModel
6
  import numpy as np
7
  import cv2
8
+ import torch
9
  from vtoonify_model import Model
10
 
11
  app = FastAPI()
12
 
13
  # Load the model
14
+ model = Model(device='cuda' if torch.cuda.is_available() else 'cpu')
 
15
  exstyle, message = model.load_model("cartoon1")
16
 
17
  class ImageRequest(BaseModel):