yuhe6 commited on
Commit
fa449b5
1 Parent(s): af091f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -7,10 +7,11 @@ import gradio as gr
7
  #os.system("wget https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt")
8
 
9
  #model = torch.hub.load('huawei-noah/ghostnet', 'ghostnet_1x', pretrained=True)
10
- torch.hub.download_url_to_file('https://huggingface.co/spaces/yuhe6/final_project/blob/main/Net_Rotate9.pth', '/tmp/temporary_file')
11
- model = torch.hub.load('/tmp', 'temporary_file', pretrained=True)
 
12
 
13
- model.eval()
14
  # Download an example image from the pytorch website
15
  torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
16
 
 
7
  #os.system("wget https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt")
8
 
9
  #model = torch.hub.load('huawei-noah/ghostnet', 'ghostnet_1x', pretrained=True)
10
+ model = torch.jit.load('https://huggingface.co/spaces/yuhe6/final_project/blob/main/Net_Rotate9.pth').eval().to(device)
11
+ #torch.hub.download_url_to_file('https://huggingface.co/spaces/yuhe6/final_project/blob/main/Net_Rotate9.pth', '/tmp/temporary_file')
12
+ #model = torch.hub.load('/tmp', 'temporary_file', pretrained=True)
13
 
14
+ #model.eval()
15
  # Download an example image from the pytorch website
16
  torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
17