Thouph commited on
Commit
f6d73a8
1 Parent(s): cdedc73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -4,6 +4,7 @@ random.seed(999)
4
  import torch
5
  from torchvision.transforms import transforms
6
  import gradio as gr
 
7
 
8
  model = torch.load('model.pth', map_location=torch.device('cpu'))
9
  model.eval()
@@ -49,6 +50,8 @@ def create_tags(image, threshold):
49
  # print("Before adding implicated tags, there are " + str(len(temp)) + " tags")
50
  temp = [t[0] for t in temp]
51
  text_no_impl = " ".join(temp)
 
 
52
  return text_no_impl, tag_score
53
 
54
  demo = gr.Interface(
 
4
  import torch
5
  from torchvision.transforms import transforms
6
  import gradio as gr
7
+ from datetime import datetime
8
 
9
  model = torch.load('model.pth', map_location=torch.device('cpu'))
10
  model.eval()
 
50
  # print("Before adding implicated tags, there are " + str(len(temp)) + " tags")
51
  temp = [t[0] for t in temp]
52
  text_no_impl = " ".join(temp)
53
+ current_datetime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
54
+ print(f"{current_datetime}: finished.")
55
  return text_no_impl, tag_score
56
 
57
  demo = gr.Interface(