Shaltiel commited on
Commit
5d783f7
1 Parent(s): f8dec43

Added escaping for angle bracketts

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -44,7 +44,8 @@ def model_chat(query: Optional[str], history: Optional[History]) -> Generator[Tu
44
  full_response = message
45
  for completion in gen:
46
  text = completion.choices[0].text
47
- full_response += text or ''
 
48
  yield full_response
49
 
50
  def create_stream_fn(orig_stream_fn):
 
44
  full_response = message
45
  for completion in gen:
46
  text = completion.choices[0].text
47
+ if text:
48
+ full_response += text.replace('<', '&lt;').replace('>', '&gt;') or ''
49
  yield full_response
50
 
51
  def create_stream_fn(orig_stream_fn):