Spaces:
Runtime error
Runtime error
Commit
·
5b09180
1
Parent(s):
9b50001
log time
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
import time, uuid
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
6 |
|
@@ -67,11 +67,15 @@ def setup():
|
|
67 |
return pipeline
|
68 |
|
69 |
|
|
|
|
|
|
|
|
|
70 |
def log(msg, st_state):
|
71 |
session_id = st_state.session_id if 'session_id' in st_state else None
|
72 |
n_gen = st.session_state.n_gen if 'n_gen' in st_state else None
|
73 |
|
74 |
-
print(f"{session_id} ({n_gen}th gen):\n\t{msg}\n")
|
75 |
|
76 |
def handler(text, ts1, ts2, gs1, st_state):
|
77 |
pipeline = setup()
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
import time, uuid, datetime
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
6 |
|
|
|
67 |
return pipeline
|
68 |
|
69 |
|
70 |
+
def now_str():
|
71 |
+
return datetime.utcnow().strftime('%Y-%m-%d %H-%M-%S')
|
72 |
+
|
73 |
+
|
74 |
def log(msg, st_state):
|
75 |
session_id = st_state.session_id if 'session_id' in st_state else None
|
76 |
n_gen = st.session_state.n_gen if 'n_gen' in st_state else None
|
77 |
|
78 |
+
print(f"{now_str()} {session_id} ({n_gen}th gen):\n\t{msg}\n")
|
79 |
|
80 |
def handler(text, ts1, ts2, gs1, st_state):
|
81 |
pipeline = setup()
|