Raaniel commited on
Commit
e86092a
1 Parent(s): 715780e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -4,6 +4,7 @@ from torch.utils.data import Dataset, DataLoader
4
  import torchvision
5
  from PIL import Image
6
  import gradio as gr
 
7
 
8
  # Configure device
9
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
@@ -14,7 +15,11 @@ transform = torchvision.transforms.Compose([
14
  torchvision.transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.225, 0.225, 0.225])
15
  ])
16
 
17
- model = torch.jit.load('model_smoke.pt')
 
 
 
 
18
  model = model.to(device)
19
 
20
  classes = ["chmury", 'inne', "dym"]
 
4
  import torchvision
5
  from PIL import Image
6
  import gradio as gr
7
+ from huggingface_hub import hf_hub_download
8
 
9
  # Configure device
10
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
 
15
  torchvision.transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.225, 0.225, 0.225])
16
  ])
17
 
18
+ REPO_ID = "Raaniel/model-smoke"
19
+ MODEL_FILE_NAME = "model_smoke.pt"
20
+ checkpoint_path = hf_hub_download(repo_id=REPO_ID, filename=MODEL_FILE_NAME)
21
+
22
+ model = torch.jit.load(checkpoint_path)
23
  model = model.to(device)
24
 
25
  classes = ["chmury", 'inne', "dym"]