ka1kuk commited on
Commit
f189f45
1 Parent(s): 53f828d

Update networks/message_streamer.py

Browse files
Files changed (1) hide show
  1. networks/message_streamer.py +1 -1
networks/message_streamer.py CHANGED
@@ -31,7 +31,7 @@ class MessageStreamer:
31
 
32
  def parse_line(self, line):
33
  line = line.decode("utf-8")
34
- line = re.sub(pattern, replacement, string)
35
  data = json.loads(line)
36
  content = data["token"]["text"]
37
  return content
 
31
 
32
  def parse_line(self, line):
33
  line = line.decode("utf-8")
34
+ line = re.sub(r"data:\s*", "", line) # Corrected use of re.sub
35
  data = json.loads(line)
36
  content = data["token"]["text"]
37
  return content