ysharma HF staff commited on
Commit
095803b
1 Parent(s): 3eacac7
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ def predict(message, chatbot):
39
  if decoded_line.startswith('data:'):
40
  json_line = decoded_line[5:] # Exclude the first 5 characters ('data:')
41
  else:
42
- gr.Warning("This line does not start with 'data:':", decoded_line)
43
  continue
44
 
45
  # Load as JSON
@@ -47,7 +47,7 @@ def predict(message, chatbot):
47
  partial_message = partial_message + json.loads(json_line)['token']['text']
48
  yield partial_message
49
  except json.JSONDecodeError:
50
- gr.Warning("This line is not valid JSON: ", json_line)
51
  continue
52
 
53
  gr.ChatInterface(predict, title=title, description=description, css=css).queue(concurrency_count=75).launch()
 
39
  if decoded_line.startswith('data:'):
40
  json_line = decoded_line[5:] # Exclude the first 5 characters ('data:')
41
  else:
42
+ print("This line does not start with 'data:':", decoded_line)
43
  continue
44
 
45
  # Load as JSON
 
47
  partial_message = partial_message + json.loads(json_line)['token']['text']
48
  yield partial_message
49
  except json.JSONDecodeError:
50
+ print("This line is not valid JSON: ", json_line)
51
  continue
52
 
53
  gr.ChatInterface(predict, title=title, description=description, css=css).queue(concurrency_count=75).launch()