ryanzhangfan commited on
Commit
feb19c1
1 Parent(s): 862c154

add more detailed logs

Browse files
Files changed (1) hide show
  1. demo/meta.py +10 -3
demo/meta.py CHANGED
@@ -8,7 +8,7 @@
8
  # Email : zhangfan@baai.ac.cn
9
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
10
  # Create On : 2023-12-12 02:54
11
- # Last Modified : 2023-12-20 04:08
12
  # File Name : meta.py
13
  # Description :
14
  #
@@ -92,7 +92,7 @@ class DataMeta:
92
 
93
  def format_chatbot(self):
94
  match self.datatype:
95
- case DataType.TEXT:
96
  return self.text_str
97
  case DataType.IMAGE:
98
  return self.image_str
@@ -287,7 +287,14 @@ class ConvMeta:
287
  self.message.pop()
288
 
289
  def pop_error(self):
290
- self.message = [(r, p) for r, p in self.message if p.datatype != DataType.ERROR]
 
 
 
 
 
 
 
291
 
292
  @property
293
  def has_gen(self):
 
8
  # Email : zhangfan@baai.ac.cn
9
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
10
  # Create On : 2023-12-12 02:54
11
+ # Last Modified : 2023-12-20 05:48
12
  # File Name : meta.py
13
  # Description :
14
  #
 
92
 
93
  def format_chatbot(self):
94
  match self.datatype:
95
+ case DataType.TEXT | DataType.ERROR:
96
  return self.text_str
97
  case DataType.IMAGE:
98
  return self.image_str
 
287
  self.message.pop()
288
 
289
  def pop_error(self):
290
+ new_message = []
291
+ for r, p in self.message:
292
+ if p.datatype == DataType.ERROR:
293
+ logging.info(f"{self.log_id}: pop error message: {p.text_str}")
294
+ else:
295
+ new_message.append((r, p))
296
+ del self.message
297
+ self.message = new_message
298
 
299
  @property
300
  def has_gen(self):