Narsil HF staff commited on
Commit
adfc825
1 Parent(s): b42abb6

Logging runtime.

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import requests
3
  import torch
4
  import gradio as gr
5
  import random
 
6
  from PIL import Image
7
  import os
8
  import time
@@ -58,6 +59,7 @@ def chat(
58
  history,
59
  progress=gr.Progress(track_tqdm=True),
60
  ):
 
61
  progress(0, desc="Starting...")
62
  # if message == "revert": --to add revert functionality later
63
  if counter_out > 0:
@@ -96,6 +98,7 @@ def chat(
96
  edited_image.save(fp)
97
  # Get the name of the saved image
98
  saved_image_name2 = fp.name
 
99
  history = history or []
100
  # Resizing (or not) the image for better display and adding supportive sample text
101
  add_text_list = [
 
3
  import torch
4
  import gradio as gr
5
  import random
6
+ import datetime
7
  from PIL import Image
8
  import os
9
  import time
 
59
  history,
60
  progress=gr.Progress(track_tqdm=True),
61
  ):
62
+ start = datetime.datetime.now()
63
  progress(0, desc="Starting...")
64
  # if message == "revert": --to add revert functionality later
65
  if counter_out > 0:
 
98
  edited_image.save(fp)
99
  # Get the name of the saved image
100
  saved_image_name2 = fp.name
101
+ print(f"Ran in {datetime.datetime.now() - start}")
102
  history = history or []
103
  # Resizing (or not) the image for better display and adding supportive sample text
104
  add_text_list = [