Spaces:
Running
on
T4
Running
on
T4
ffreemt
commited on
Commit
·
79b022b
1
Parent(s):
7ea83b4
Update turn trace on
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ torch.cuda.empty_cache()
|
|
10 |
# pylint: disable=line-too-long, invalid-name, no-member, redefined-outer-name, missing-function-docstring, missing-class-docstring, broad-except,
|
11 |
import gc
|
12 |
import os
|
|
|
13 |
import time
|
14 |
from collections import deque
|
15 |
from dataclasses import asdict, dataclass
|
@@ -68,14 +69,16 @@ def user_clear(message, chat_history):
|
|
68 |
"""Gen a response, clear message in user textbox."""
|
69 |
logger.debug(f"{message=}")
|
70 |
|
71 |
-
|
72 |
-
|
73 |
logger.trace(f"{chat_history=}")
|
74 |
|
75 |
try:
|
76 |
chat_history.append([message, ""])
|
77 |
except Exception:
|
78 |
chat_history = deque([message, ""], maxlen=5)
|
|
|
|
|
79 |
return "", chat_history
|
80 |
|
81 |
|
|
|
10 |
# pylint: disable=line-too-long, invalid-name, no-member, redefined-outer-name, missing-function-docstring, missing-class-docstring, broad-except,
|
11 |
import gc
|
12 |
import os
|
13 |
+
import sys
|
14 |
import time
|
15 |
from collections import deque
|
16 |
from dataclasses import asdict, dataclass
|
|
|
69 |
"""Gen a response, clear message in user textbox."""
|
70 |
logger.debug(f"{message=}")
|
71 |
|
72 |
+
logger.remove() # to turn on trace
|
73 |
+
logger.add(sys.stderr, level="TRACE")
|
74 |
logger.trace(f"{chat_history=}")
|
75 |
|
76 |
try:
|
77 |
chat_history.append([message, ""])
|
78 |
except Exception:
|
79 |
chat_history = deque([message, ""], maxlen=5)
|
80 |
+
|
81 |
+
logger.trace(f"{chat_history=}")
|
82 |
return "", chat_history
|
83 |
|
84 |
|